Spring security: get user from implementation of UserDetails from Authorization
Im trying to extract the user of a request through the Authorization object.
this is my implementation of UserDetails:
i tried getting the user by downcasting to my implementation and then getting the user but im getting an error that class org.springframework.security.oauth2.jwt.Jwt cannot be cast to class UserPrincipal.
Am i misunderstading something about the authentication.getPrincipal()? what would be the best way to get the user from the authentication?
1 Reply
⌛ This post has been reserved for your question.
Hey @Victor! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.