(Fixed) Oauth server works yet in endpoint Principal is null [SPR-17132] #21669
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: invalid
An issue that we don't feel is valid
Martijn opened SPR-17132 and commented
I have build a oauth2 server using Spring boot 2.0.8 which uses Spring 5.0.8. The oauth server works and I receive an access token. I can verify that my ResourceServerConfigurerAdapter works because when I access a url with the incorrect access token I get an authentication error so the authentication server + resource server section works.
I want to create an endpoint that other microservices use call to get the current loggedin user. So I created an endpoint like this:
I startup Postman, request a new access token, do a call to /user with the access token supplied as bearer token and start the request. No matter what I do principal is always null. I have even added
@AuthenticationPrincipal
to the Principal principal argument and yet principal is null. I have also tried the following:This also returns null. How is it possible that Principal and getAuthentication() return null?
Affects: 5.0.8
The text was updated successfully, but these errors were encountered: