Class JwtAuthenticationToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken<Jwt>
org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken
- All Implemented Interfaces:
Serializable
,Principal
,Authentication
,CredentialsContainer
- Since:
- 5.1
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs aJwtAuthenticationToken
using the provided parameters.JwtAuthenticationToken
(Jwt jwt, Collection<? extends GrantedAuthority> authorities) Constructs aJwtAuthenticationToken
using the provided parameters.JwtAuthenticationToken
(Jwt jwt, Collection<? extends GrantedAuthority> authorities, String name) Constructs aJwtAuthenticationToken
using the provided parameters. -
Method Summary
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 Details
-
JwtAuthenticationToken
Constructs aJwtAuthenticationToken
using the provided parameters.- Parameters:
jwt
- the JWT
-
JwtAuthenticationToken
Constructs aJwtAuthenticationToken
using the provided parameters.- Parameters:
jwt
- the JWTauthorities
- the authorities assigned to the JWT
-
JwtAuthenticationToken
public JwtAuthenticationToken(Jwt jwt, Collection<? extends GrantedAuthority> authorities, String name) Constructs aJwtAuthenticationToken
using the provided parameters.- Parameters:
jwt
- the JWTauthorities
- the authorities assigned to the JWTname
- the principal name
-
-
Method Details
-
getTokenAttributes
Description copied from class:AbstractOAuth2TokenAuthenticationToken
Returns the attributes of the access token.- Specified by:
getTokenAttributes
in classAbstractOAuth2TokenAuthenticationToken<Jwt>
- Returns:
- a
Map
of the attributes in the access token.
-
getName
The principal name which is, by default, theJwt
's subject- Specified by:
getName
in interfacePrincipal
- Overrides:
getName
in classAbstractAuthenticationToken
-