token-key-access property is not working
while I'm permit all for token key in Authorization server as putting below in application.properties:
security.oauth2.authorization.check-token-access=permitAll()
security.oauth2.authorization.token-key-access=permitAll()
I got 401 Unauthorized in resource server also when I'm trying to access it using curl.
using version 1.3.3.RELEASE
I found the problem, it is in OAuth project in TokenKeyEndpoint class, there is condition as :
if ((principal == null || principal instanceof AnonymousAuthenticationToken) && !converter.isPublic()) {
throw new AccessDeniedException("You need to authenticate to see a shared key");
}
it is checking if key .isPublic() and if it is not it is throwing AccessDeniedException then you get 401 with not descriptive message.
@bassemZohdy i'm also having this problem in v1.3.3
The TokenKeyEndpoint class is not part of Spring Boot so if the problem lies there we'll need to move this issue.
/cc @dsyer
It's not an issue as far as I can see. The exception says precisely why it was thrown: the key is not public, so it can't be revealed.