public static class OAuth2Authorization.Builder
extends java.lang.Object
implements java.io.Serializable
OAuth2Authorization.| Modifier | Constructor and Description |
|---|---|
protected |
Builder(java.lang.String registeredClientId) |
| Modifier and Type | Method and Description |
|---|---|
OAuth2Authorization.Builder |
accessToken(org.springframework.security.oauth2.core.OAuth2AccessToken accessToken)
Sets the
access token. |
OAuth2Authorization.Builder |
attribute(java.lang.String name,
java.lang.Object value)
Adds an attribute associated to the authorization.
|
OAuth2Authorization.Builder |
attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
A
Consumer of the attributes Map
allowing the ability to add, replace, or remove. |
OAuth2Authorization.Builder |
authorizationGrantType(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType)
Sets the
authorization grant type used for the authorization. |
OAuth2Authorization |
build()
Builds a new
OAuth2Authorization. |
OAuth2Authorization.Builder |
id(java.lang.String id)
Sets the identifier for the authorization.
|
OAuth2Authorization.Builder |
principalName(java.lang.String principalName)
Sets the
Principal name of the resource owner (or client). |
OAuth2Authorization.Builder |
refreshToken(org.springframework.security.oauth2.core.OAuth2RefreshToken refreshToken)
Sets the
refresh token. |
<T extends org.springframework.security.oauth2.core.OAuth2Token> |
token(T token)
Sets the
token. |
<T extends org.springframework.security.oauth2.core.OAuth2Token> |
token(T token,
java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> metadataConsumer)
Sets the
token and associated metadata. |
protected OAuth2Authorization.Builder |
tokens(java.util.Map<java.lang.Class<? extends org.springframework.security.oauth2.core.OAuth2Token>,OAuth2Authorization.Token<?>> tokens) |
public OAuth2Authorization.Builder id(java.lang.String id)
id - the identifier for the authorizationOAuth2Authorization.Builderpublic OAuth2Authorization.Builder principalName(java.lang.String principalName)
Principal name of the resource owner (or client).principalName - the Principal name of the resource owner (or client)OAuth2Authorization.Builderpublic OAuth2Authorization.Builder authorizationGrantType(org.springframework.security.oauth2.core.AuthorizationGrantType authorizationGrantType)
authorization grant type used for the authorization.authorizationGrantType - the AuthorizationGrantTypeOAuth2Authorization.Builderpublic OAuth2Authorization.Builder accessToken(org.springframework.security.oauth2.core.OAuth2AccessToken accessToken)
access token.accessToken - the OAuth2AccessTokenOAuth2Authorization.Builderpublic OAuth2Authorization.Builder refreshToken(org.springframework.security.oauth2.core.OAuth2RefreshToken refreshToken)
refresh token.refreshToken - the OAuth2RefreshTokenOAuth2Authorization.Builderpublic <T extends org.springframework.security.oauth2.core.OAuth2Token> OAuth2Authorization.Builder token(T token)
token.T - the type of the tokentoken - the tokenOAuth2Authorization.Builderpublic <T extends org.springframework.security.oauth2.core.OAuth2Token> OAuth2Authorization.Builder token(T token, java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> metadataConsumer)
token and associated metadata.T - the type of the tokentoken - the tokenmetadataConsumer - a Consumer of the metadata MapOAuth2Authorization.Builderprotected final OAuth2Authorization.Builder tokens(java.util.Map<java.lang.Class<? extends org.springframework.security.oauth2.core.OAuth2Token>,OAuth2Authorization.Token<?>> tokens)
public OAuth2Authorization.Builder attribute(java.lang.String name, java.lang.Object value)
name - the name of the attributevalue - the value of the attributeOAuth2Authorization.Builderpublic OAuth2Authorization.Builder attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
Consumer of the attributes Map
allowing the ability to add, replace, or remove.attributesConsumer - a Consumer of the attributes MapOAuth2Authorization.Builderpublic OAuth2Authorization build()
OAuth2Authorization.OAuth2Authorization