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