Class JwtAuthenticationToken.Builder<B extends JwtAuthenticationToken.Builder<B>>
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<Jwt,B>
org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken.Builder<B>
- All Implemented Interfaces:
Authentication.Builder<B>
- Enclosing class:
- JwtAuthenticationToken
public static class JwtAuthenticationToken.Builder<B extends JwtAuthenticationToken.Builder<B>>
extends AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<Jwt,B>
A builder for
JwtAuthenticationToken instances- Since:
- 7.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build anAuthenticationinstancecredentials(@Nullable Object credentials) A synonym fortoken(Jwt)The name to use.A synonym fortoken(Jwt)Use thistokenas the token, principal, and credentials.Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder
authenticated, authorities, details
-
Constructor Details
-
Builder
-
-
Method Details
-
principal
A synonym fortoken(Jwt)- Specified by:
principalin interfaceAuthentication.Builder<B extends JwtAuthenticationToken.Builder<B>>- Overrides:
principalin classAbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<Jwt,B extends JwtAuthenticationToken.Builder<B>> - Parameters:
principal- the principal to use- Returns:
- the
JwtAuthenticationToken.Builderfor further configurations - See Also:
-
credentials
A synonym fortoken(Jwt)- Specified by:
credentialsin interfaceAuthentication.Builder<B extends JwtAuthenticationToken.Builder<B>>- Overrides:
credentialsin classAbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<Jwt,B extends JwtAuthenticationToken.Builder<B>> - Parameters:
credentials- the credentials to use- Returns:
- the
JwtAuthenticationToken.Builderfor further configurations - See Also:
-
token
Use thistokenas the token, principal, and credentials. Also sets thenametoJwtClaimAccessor.getSubject().- Overrides:
tokenin classAbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<Jwt,B extends JwtAuthenticationToken.Builder<B>> - Parameters:
token- the token to use- Returns:
- the
JwtAuthenticationToken.Builderfor further configurations
-
name
The name to use.- Parameters:
name- the name to use- Returns:
- the
JwtAuthenticationToken.Builderfor further configurations
-
build
Description copied from interface:Authentication.BuilderBuild anAuthenticationinstance- Returns:
- the
Authenticationinstance
-