// signature, subject confirmation, etc
super.validateToken(message, wrapper);
// This is specific to OAuth2 path
// Introduce SAMLOAuth2Validator to be reused between auth and grant handlers
Subject subject = SAMLUtils.getSubject(message, wrapper);
if (subject.getName() == null) {
throw new NotAuthorizedException(errorResponse());
}
if (clientId != null && !clientId.equals(subject.getName())) {
//TODO: Attempt to map client_id to subject.getName()
throw new NotAuthorizedException(errorResponse());
}
samlOAuthValidator.validate(message, wrapper);
message.put(OAuthConstants.CLIENT_ID, subject.getName());
}