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 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 claims
      jwt - the decoded JWT token
  • Method Details

    • getCredentials

      public org.springframework.security.oauth2.jwt.Jwt getCredentials()
    • equals

      public boolean equals(Object other)
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class org.springframework.security.authentication.AbstractAuthenticationToken
    • getPrincipal

      public UserPrincipal getPrincipal()
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class org.springframework.security.authentication.AbstractAuthenticationToken