use of edu.uiuc.ncsa.security.delegation.token.AuthorizationGrant in project OA4MP by ncsa.
the class TransactionStoreTest method newAG.
protected AuthorizationGrant newAG(String... x) {
AuthorizationGrant ag = getTSProvider().getTokenForge().getAuthorizationGrant(x);
// The forge may return a shared secret. Since we never use this in OA4MP, make sure it is null
// or you will get false test results since the secret won't be stored.
ag.setSharedSecret(null);
return ag;
}
use of edu.uiuc.ncsa.security.delegation.token.AuthorizationGrant in project OA4MP by ncsa.
the class AbstractAuthorizationServlet method getAndCheckTransaction.
/*
Get the transaction associated with the authorization grant token and check that it passes sanity
checks. If so, return it, If not, throw the appropriate exception.
*/
protected ServiceTransaction getAndCheckTransaction(String token) throws IOException {
DateUtils.checkTimestamp(token);
AuthorizationGrant grant = MyProxyDelegationServlet.getServiceEnvironment().getTokenForge().getAuthorizationGrant(token);
ServiceTransaction trans = MyProxyDelegationServlet.getServiceEnvironment().getTransactionStore().get(grant);
if (trans == null) {
warn("Error: no delegation request found for " + token);
throw new GeneralException("Error: no delegation request found.");
}
checkClientApproval(trans.getClient());
return trans;
}
use of edu.uiuc.ncsa.security.delegation.token.AuthorizationGrant in project OA4MP by ncsa.
the class AuthorizedServlet method getAndCheckTransaction.
/*
Get the transaction associated with the authorization grant token and check that it passes sanity
checks. If so, return it, If not, throw the appropriate exception.
*/
protected ServiceTransaction getAndCheckTransaction(ProtocolParameters p) throws Throwable {
String token = p.token;
DateUtils.checkTimestamp(token);
AuthorizationGrant grant = MyProxyDelegationServlet.getServiceEnvironment().getTokenForge().getAuthorizationGrant(token);
checkTimestamp(grant.getToken());
ServiceTransaction trans = MyProxyDelegationServlet.getServiceEnvironment().getTransactionStore().get(grant);
if (trans == null) {
warn("Error: no delegation request found for " + token);
throw new GeneralException("Error: no delegation request found.");
}
checkClientApproval(trans.getClient());
return trans;
}
Aggregations