Search in sources :

Example 1 with UnapprovedClientException

use of edu.uiuc.ncsa.security.delegation.server.UnapprovedClientException in project OA4MP by ncsa.

the class AbstractInitServlet method doDelegation.

/**
 * Actual work call. This parses and returns the passed in parameters.
 *
 * @param req
 * @param resp
 * @return
 * @throws java.io.IOException
 * @throws javax.servlet.ServletException
 */
protected void doDelegation(HttpServletRequest req, HttpServletResponse resp) throws Throwable {
    Client client = getClient(req);
    try {
        String cid = "client=" + client.getIdentifier();
        info("2.a. Starting a new cert request: " + cid);
        checkClientApproval(client);
        AGResponse agResponse = (AGResponse) getAGI().process(new AGRequest(req, client));
        agResponse.setClient(client);
        ServiceTransaction transaction = verifyAndGet(agResponse);
        transaction.setClient(client);
        getTransactionStore().save(transaction);
        info("Saved new transaction with id=" + transaction.getIdentifierString());
        Map<String, String> params = agResponse.getParameters();
        preprocess(new TransactionState(req, resp, params, transaction));
        debug("saved transaction for " + cid + ", trans id=" + transaction.getIdentifierString());
        agResponse.write(resp);
        info("2.b finished initial request for token =\"" + transaction.getIdentifierString() + "\".");
        postprocess(new IssuerTransactionState(req, resp, params, transaction, agResponse));
    } catch (Throwable t) {
        if (t instanceof UnapprovedClientException) {
            warn("Unapproved client: " + client.getIdentifierString());
        }
        throw t;
    }
}
Also used : TransactionState(edu.uiuc.ncsa.security.delegation.servlet.TransactionState) AGRequest(edu.uiuc.ncsa.security.delegation.server.request.AGRequest) ServiceTransaction(edu.uiuc.ncsa.security.delegation.server.ServiceTransaction) AGResponse(edu.uiuc.ncsa.security.delegation.server.request.AGResponse) UnapprovedClientException(edu.uiuc.ncsa.security.delegation.server.UnapprovedClientException) Client(edu.uiuc.ncsa.security.delegation.storage.Client)

Aggregations

ServiceTransaction (edu.uiuc.ncsa.security.delegation.server.ServiceTransaction)1 UnapprovedClientException (edu.uiuc.ncsa.security.delegation.server.UnapprovedClientException)1 AGRequest (edu.uiuc.ncsa.security.delegation.server.request.AGRequest)1 AGResponse (edu.uiuc.ncsa.security.delegation.server.request.AGResponse)1 TransactionState (edu.uiuc.ncsa.security.delegation.servlet.TransactionState)1 Client (edu.uiuc.ncsa.security.delegation.storage.Client)1