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?
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?