When I am trying to validate the token, oauth2-security msf4j returns null pointer exception, without giving any more detail. On debugging it appears that getValidatedTokenResponse is returning empty and so NPE is coming: I verified the token and configuration, and everything seems to be fine.
private boolean validateToken(String authHeader) throws MSF4JSecurityException {
String accessToken = this.extractAccessToken(authHeader);
String responseStr = this.getValidatedTokenResponse(accessToken);
Map responseData = this.getResponseDataMap(responseStr);
if(!Boolean.parseBoolean((String)responseData.get("active"))) {
throw new MSF4JSecurityException(SecurityErrorCode.AUTHENTICATION_FAILURE, "Invalid Access token.");
} else {
return true;
}
}
When I used spring security to verify the token, it worked fine..