use of edu.uiuc.ncsa.security.core.exceptions.TransactionNotFoundException in project OA4MP by ncsa.
the class AccessTokenServlet method verifyAndGet.
@Override
public ServiceTransaction verifyAndGet(IssuerResponse iResponse) throws IOException {
ATResponse atResponse = (ATResponse) iResponse;
Verifier verifier = atResponse.getVerifier();
debug("5.a. verifier = " + atResponse.getVerifier());
checkTimestamp(verifier.getToken());
ServiceTransaction transaction = (ServiceTransaction) getTransactionStore().get(verifier);
if (transaction == null) {
throw new TransactionNotFoundException("No transaction found for verifier " + verifier);
}
checkClientApproval(transaction.getClient());
String cc = "client=" + transaction.getClient().getIdentifierString();
info("5.a. " + cc);
debug("5.a. grant valid=" + transaction.isAuthGrantValid() + ", at valid=" + transaction.isAccessTokenValid());
if (!transaction.isAuthGrantValid() || transaction.isAccessTokenValid()) {
String msg = "Error: the state of the transaction is invalid for auth grant " + transaction.getAuthorizationGrant();
warn(msg);
throw new GeneralException(msg);
}
return transaction;
}
Aggregations