Search in sources :

Example 26 with Client

use of edu.uiuc.ncsa.security.delegation.storage.Client in project OA4MP by ncsa.

the class ErrorServlet method doIt.

@Override
protected void doIt(HttpServletRequest request, HttpServletResponse response) throws Throwable {
    String cause = request.getParameter(CAUSE);
    String identifier = request.getParameter(IDENTIFIER);
    request.setAttribute(CAUSE, cause);
    request.setAttribute(IDENTIFIER, identifier);
    request.setAttribute(MESSAGE, URLDecoder.decode(request.getParameter(MESSAGE), "UTF-8"));
    String stackTrace = request.getParameter(STACK_TRACE);
    if (stackTrace == null || stackTrace.length() == 0) {
        stackTrace = "(none)";
    } else {
        try {
            stackTrace = new String(Base64.decodeBase64(stackTrace));
        } catch (Throwable x) {
            info("Could not decode stack trace for cause " + x.getClass().getName() + " msg=\"" + x.getMessage() + "\", trace:" + stackTrace);
            stackTrace = "(none)";
        }
    }
    request.setAttribute(STACK_TRACE, stackTrace);
    if (cause.equals(UnknownClientException.class.getSimpleName())) {
        JSPUtil.fwd(request, response, "/noClientErrorPage.jsp");
        return;
    }
    Client client = getClient(BasicIdentifier.newID(identifier));
    request.setAttribute("client", client);
    JSPUtil.fwd(request, response, "/errorPage2.jsp");
}
Also used : UnknownClientException(edu.uiuc.ncsa.security.core.exceptions.UnknownClientException) Client(edu.uiuc.ncsa.security.delegation.storage.Client)

Aggregations

Client (edu.uiuc.ncsa.security.delegation.storage.Client)26 BasicIdentifier (edu.uiuc.ncsa.security.core.util.BasicIdentifier)8 Test (org.junit.Test)7 ClientApproval (edu.uiuc.ncsa.security.delegation.server.storage.ClientApproval)6 Date (java.util.Date)6 Identifier (edu.uiuc.ncsa.security.core.Identifier)5 OA4MPIdentifierProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider)3 OA2ClientMemoryStore (edu.uiuc.ncsa.myproxy.oa4mp.oauth2.storage.OA2ClientMemoryStore)2 OA4MPServiceTransaction (edu.uiuc.ncsa.myproxy.oa4mp.server.OA4MPServiceTransaction)2 UnknownClientException (edu.uiuc.ncsa.security.core.exceptions.UnknownClientException)2 ClientProvider (edu.uiuc.ncsa.security.delegation.storage.ClientProvider)2 ClientConverter (edu.uiuc.ncsa.security.delegation.storage.impl.ClientConverter)2 OA2Client (edu.uiuc.ncsa.security.oauth_2_0.OA2Client)2 OA2ClientConverter (edu.uiuc.ncsa.security.oauth_2_0.OA2ClientConverter)2 OA2ClientProvider (edu.uiuc.ncsa.security.oauth_2_0.OA2ClientProvider)2 JSONObject (net.sf.json.JSONObject)2 OA4MPServiceProvider (edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPServiceProvider)1 AssetProvider (edu.uiuc.ncsa.myproxy.oa4mp.client.storage.AssetProvider)1 AdminClient (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClient)1 MultiDSClientStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientStoreProvider)1