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
-
Method Summary
Modifier and TypeMethodDescriptionauthorization
(OAuth2Authorization authorization) Sets theauthorization
.authorizationGrant
(org.springframework.security.core.Authentication authorizationGrant) Sets theAuthentication
representing 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 T
build()
Builds a newOAuth2TokenContext
.AConsumer
of the attributesMap
allowing the ability to add, replace, or remove.protected <V> V
protected final B
getThis()
principal
(org.springframework.security.core.Authentication principal) Sets theAuthentication
representing thePrincipal
resource 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.AbstractBuilder
for further configuration
-
principal
Sets theAuthentication
representing thePrincipal
resource owner (or client).- Parameters:
principal
- theAuthentication
representing thePrincipal
resource owner (or client)- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
authorizationServerContext
Sets theauthorization server context
.- Parameters:
authorizationServerContext
- theAuthorizationServerContext
- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration - Since:
- 0.2.3
-
authorization
Sets theauthorization
.- Parameters:
authorization
- theOAuth2Authorization
- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
authorizedScopes
Sets the authorized scope(s).- Parameters:
authorizedScopes
- the authorized scope(s)- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
tokenType
Sets thetoken type
.- Parameters:
tokenType
- theOAuth2TokenType
- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
authorizationGrantType
public B authorizationGrantType(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType) Sets theauthorization grant type
.- Parameters:
authorizationGrantType
- theAuthorizationGrantType
- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
authorizationGrant
Sets theAuthentication
representing the authorization grant.- Parameters:
authorizationGrant
- theAuthentication
representing the authorization grant- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
put
Associates an attribute.- Parameters:
key
- the key for the attributevalue
- the value of the attribute- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
context
AConsumer
of the attributesMap
allowing the ability to add, replace, or remove.- Parameters:
contextConsumer
- aConsumer
of the attributesMap
- Returns:
- the
OAuth2TokenContext.AbstractBuilder
for further configuration
-
get
-
getContext
-
getThis
-
build
Builds a newOAuth2TokenContext
.- Returns:
- the
OAuth2TokenContext
-