Class BearerTokenAuthentication.Builder<B extends BearerTokenAuthentication.Builder<B>>
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<OAuth2AccessToken,B>
org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication.Builder<B>
- All Implemented Interfaces:
Authentication.Builder<B>
- Enclosing class:
- BearerTokenAuthentication
public static class BearerTokenAuthentication.Builder<B extends BearerTokenAuthentication.Builder<B>>
extends AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<OAuth2AccessToken,B>
A builder preserving the concrete
Authentication type- Since:
- 7.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build anAuthenticationinstancecredentials(@Nullable Object token) A synonym fortoken(OAuth2AccessToken)Use this principal.token(OAuth2AccessToken token) Use this token.Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder
authenticated, authorities, details
-
Constructor Details
-
Builder
-
-
Method Details
-
principal
Use this principal. Must be of typeOAuth2AuthenticatedPrincipal- Specified by:
principalin interfaceAuthentication.Builder<B extends BearerTokenAuthentication.Builder<B>>- Overrides:
principalin classAbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<OAuth2AccessToken,B extends BearerTokenAuthentication.Builder<B>> - Parameters:
principal- the principal to use- Returns:
- the
BearerTokenAuthentication.Builderfor further configurations - See Also:
-
credentials
A synonym fortoken(OAuth2AccessToken)- Specified by:
credentialsin interfaceAuthentication.Builder<B extends BearerTokenAuthentication.Builder<B>>- Overrides:
credentialsin classAbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<OAuth2AccessToken,B extends BearerTokenAuthentication.Builder<B>> - Parameters:
token- the token to use- Returns:
- the
BearerTokenAuthentication.Builderfor further configurations - See Also:
-
token
Use this token. Must have aOAuth2AccessToken.getTokenType()asOAuth2AccessToken.TokenType.BEARER.- Overrides:
tokenin classAbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<OAuth2AccessToken,B extends BearerTokenAuthentication.Builder<B>> - Parameters:
token- the token to use- Returns:
- the
BearerTokenAuthentication.Builderfor further configurations
-
build
Build anAuthenticationinstance- Returns:
- the
Authenticationinstance
-