use of org.apache.cxf.sts.token.canceller.TokenCancellerResponse in project OpenAM by OpenRock.
the class TokenCancellerBase method cancelToken.
@Override
public TokenCancellerResponse cancelToken(TokenCancellerParameters tokenParameters) {
TokenCancellerResponse response = new TokenCancellerResponse();
ReceivedToken cancelTarget = tokenParameters.getToken();
cancelTarget.setState(ReceivedToken.STATE.VALID);
response.setToken(cancelTarget);
String tokenServiceConsumptionToken = null;
try {
final String tokenId = generateIdFromValidateTarget(cancelTarget);
tokenServiceConsumptionToken = getTokenServiceConsumptionToken();
tokenServiceConsumer.cancelToken(tokenId, tokenServiceConsumptionToken);
cancelTarget.setState(ReceivedToken.STATE.CANCELLED);
return response;
} catch (TokenCancellationException e) {
throw new STSException("Exception caught validating issued token: " + e.getMessage(), e);
} finally {
if (tokenServiceConsumptionToken != null) {
invalidateTokenGenerationServiceConsumptionToken(tokenServiceConsumptionToken);
}
}
}
Aggregations