use of edu.uiuc.ncsa.security.delegation.server.request.AGRequest 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;
}
}
Aggregations