Class JwtAuthenticationToken
- 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:
java.io.Serializable,java.security.Principal,org.springframework.security.core.Authentication,org.springframework.security.core.CredentialsContainer
@Transient public class JwtAuthenticationToken extends AbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.jwt.Jwt>
- Since:
- 5.1
- See Also:
AbstractOAuth2TokenAuthenticationToken,Jwt, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt)Constructs aJwtAuthenticationTokenusing the provided parameters.JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)Constructs aJwtAuthenticationTokenusing the provided parameters.JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, java.lang.String name)Constructs aJwtAuthenticationTokenusing the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()The principal name which is, by default, theJwt's subjectjava.util.Map<java.lang.String,java.lang.Object>getTokenAttributes()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
-
-
-
-
Constructor Detail
-
JwtAuthenticationToken
public JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt)
Constructs aJwtAuthenticationTokenusing the provided parameters.- Parameters:
jwt- the JWT
-
JwtAuthenticationToken
public JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)Constructs aJwtAuthenticationTokenusing the provided parameters.- Parameters:
jwt- the JWTauthorities- the authorities assigned to the JWT
-
JwtAuthenticationToken
public JwtAuthenticationToken(org.springframework.security.oauth2.jwt.Jwt jwt, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, java.lang.String name)Constructs aJwtAuthenticationTokenusing the provided parameters.- Parameters:
jwt- the JWTauthorities- the authorities assigned to the JWTname- the principal name
-
-
Method Detail
-
getTokenAttributes
public java.util.Map<java.lang.String,java.lang.Object> getTokenAttributes()
Description copied from class:AbstractOAuth2TokenAuthenticationTokenReturns the attributes of the access token.- Specified by:
getTokenAttributesin classAbstractOAuth2TokenAuthenticationToken<org.springframework.security.oauth2.jwt.Jwt>- Returns:
- a
Mapof the attributes in the access token.
-
getName
public java.lang.String getName()
The principal name which is, by default, theJwt's subject- Specified by:
getNamein interfacejava.security.Principal- Overrides:
getNamein classorg.springframework.security.authentication.AbstractAuthenticationToken
-
-