use of org.apache.cxf.rs.security.oauth2.common.AccessTokenValidation in project cxf by apache.
the class HawkAccessTokenValidator method getAccessTokenValidation.
protected AccessTokenValidation getAccessTokenValidation(MessageContext mc, String authScheme, String authSchemeData, MultivaluedMap<String, String> extraProps, Map<String, String> schemeParams) {
String macKey = schemeParams.get(OAuthConstants.HAWK_TOKEN_ID);
ServerAccessToken accessToken = dataProvider.getAccessToken(macKey);
if (!(accessToken instanceof HawkAccessToken)) {
throw new OAuthServiceException(OAuthConstants.SERVER_ERROR);
}
HawkAccessToken macAccessToken = (HawkAccessToken) accessToken;
AccessTokenValidation atv = new AccessTokenValidation(macAccessToken);
// OAuth2 Pop token introspection will likely support returning a JWE-encrypted key
if (!isRemoteSignatureValidation() || mc.getSecurityContext().isSecure()) {
atv.getExtraProps().put(OAuthConstants.HAWK_TOKEN_KEY, macAccessToken.getMacKey());
atv.getExtraProps().put(OAuthConstants.HAWK_TOKEN_ALGORITHM, macAccessToken.getMacAlgorithm());
}
return atv;
}
Aggregations