Package com.example.blogs.app.security
Class UserPrincipalAuthenticationToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
com.example.blogs.app.security.UserPrincipalAuthenticationToken
- All Implemented Interfaces:
Serializable,Principal,org.springframework.security.core.Authentication,org.springframework.security.core.CredentialsContainer
public class UserPrincipalAuthenticationToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
Spring Security authentication token holding UserPrincipal and JWT credentials.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUserPrincipalAuthenticationToken(UserPrincipal principal, org.springframework.security.oauth2.jwt.Jwt jwt) Creates an authenticated token with UserPrincipal and JWT. -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.springframework.security.oauth2.jwt.JwtinthashCode()Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
eraseCredentials, getAuthorities, getDetails, getName, isAuthenticated, setAuthenticated, setDetails, toString
-
Constructor Details
-
UserPrincipalAuthenticationToken
public UserPrincipalAuthenticationToken(UserPrincipal principal, org.springframework.security.oauth2.jwt.Jwt jwt) Creates an authenticated token with UserPrincipal and JWT.- Parameters:
principal- the user principal extracted from JWT claimsjwt- the decoded JWT token
-
-
Method Details
-
getCredentials
public org.springframework.security.oauth2.jwt.Jwt getCredentials() -
equals
-
getPrincipal
-
hashCode
public int hashCode()
-