java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.jwt.Jwt>
org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

@Transient public class JwtAuthenticationToken extends AbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.jwt.Jwt>
An implementation of an AbstractOAuth2TokenAuthenticationToken representing a Jwt Authentication.
Since:
5.1
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt)
    Constructs a JwtAuthenticationToken using the provided parameters.
    JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
    Constructs a JwtAuthenticationToken using the provided parameters.
    JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, String name)
    Constructs a JwtAuthenticationToken using the provided parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    The principal name which is, by default, the Jwt's subject
    Returns the attributes of the access token.

    Methods inherited from class org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken

    getCredentials, getPrincipal, getToken

    Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    equals, eraseCredentials, getAuthorities, getDetails, hashCode, isAuthenticated, setAuthenticated, setDetails, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.security.Principal

    implies
  • Constructor Details

    • JwtAuthenticationToken

      public JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt)
      Constructs a JwtAuthenticationToken using the provided parameters.
      Parameters:
      jwt - the JWT
    • JwtAuthenticationToken

      public JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
      Constructs a JwtAuthenticationToken using the provided parameters.
      Parameters:
      jwt - the JWT
      authorities - the authorities assigned to the JWT
    • JwtAuthenticationToken

      public JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, String name)
      Constructs a JwtAuthenticationToken using the provided parameters.
      Parameters:
      jwt - the JWT
      authorities - the authorities assigned to the JWT
      name - the principal name
  • Method Details