Class OAuth2TokenContext.AbstractBuilder<T extends OAuth2TokenContext,B extends OAuth2TokenContext.AbstractBuilder<T,B>>
java.lang.Object
org.springframework.security.oauth2.server.authorization.token.OAuth2TokenContext.AbstractBuilder<T,B>
- Type Parameters:
T- the type of the contextB- the type of the builder
- Direct Known Subclasses:
DefaultOAuth2TokenContext.Builder,JwtEncodingContext.Builder,OAuth2TokenClaimsContext.Builder
- Enclosing interface:
- OAuth2TokenContext
public abstract static class OAuth2TokenContext.AbstractBuilder<T extends OAuth2TokenContext,B extends OAuth2TokenContext.AbstractBuilder<T,B>>
extends Object
Base builder for implementations of
OAuth2TokenContext.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthorization(OAuth2Authorization authorization) Sets theauthorization.authorizationGrant(org.springframework.security.core.Authentication authorizationGrant) Sets theAuthenticationrepresenting the authorization grant.authorizationGrantType(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType) Sets theauthorization grant type.authorizationServerContext(AuthorizationServerContext authorizationServerContext) Sets theauthorization server context.authorizedScopes(Set<String> authorizedScopes) Sets the authorized scope(s).abstract Tbuild()Builds a newOAuth2TokenContext.AConsumerof the attributesMapallowing the ability to add, replace, or remove.protected <V> Vprotected final BgetThis()principal(org.springframework.security.core.Authentication principal) Sets theAuthenticationrepresenting thePrincipalresource owner (or client).Associates an attribute.registeredClient(RegisteredClient registeredClient) Sets theregistered client.tokenType(OAuth2TokenType tokenType) Sets thetoken type.
-
Constructor Details
-
AbstractBuilder
public AbstractBuilder()
-
-
Method Details
-
registeredClient
Sets theregistered client.- Parameters:
registeredClient- theRegisteredClient- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
principal
Sets theAuthenticationrepresenting thePrincipalresource owner (or client).- Parameters:
principal- theAuthenticationrepresenting thePrincipalresource owner (or client)- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
authorizationServerContext
Sets theauthorization server context.- Parameters:
authorizationServerContext- theAuthorizationServerContext- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration - Since:
- 0.2.3
-
authorization
Sets theauthorization.- Parameters:
authorization- theOAuth2Authorization- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
authorizedScopes
Sets the authorized scope(s).- Parameters:
authorizedScopes- the authorized scope(s)- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
tokenType
Sets thetoken type.- Parameters:
tokenType- theOAuth2TokenType- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
authorizationGrantType
public B authorizationGrantType(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType) Sets theauthorization grant type.- Parameters:
authorizationGrantType- theAuthorizationGrantType- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
authorizationGrant
Sets theAuthenticationrepresenting the authorization grant.- Parameters:
authorizationGrant- theAuthenticationrepresenting the authorization grant- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
put
Associates an attribute.- Parameters:
key- the key for the attributevalue- the value of the attribute- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
context
AConsumerof the attributesMapallowing the ability to add, replace, or remove.- Parameters:
contextConsumer- aConsumerof the attributesMap- Returns:
- the
OAuth2TokenContext.AbstractBuilderfor further configuration
-
get
-
getContext
-
getThis
-
build
Builds a newOAuth2TokenContext.- Returns:
- the
OAuth2TokenContext
-