public final class OAuth2AccessTokenGenerator extends java.lang.Object implements OAuth2TokenGenerator<org.springframework.security.oauth2.core.OAuth2AccessToken>
OAuth2TokenGenerator,
OAuth2AccessToken,
OAuth2TokenCustomizer,
OAuth2TokenClaimsContext,
OAuth2TokenClaimsSet| Constructor and Description |
|---|
OAuth2AccessTokenGenerator() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.oauth2.core.OAuth2AccessToken |
generate(OAuth2TokenContext context)
Generate an OAuth 2.0 Token using the attributes contained in the
OAuth2TokenContext,
or return null if the OAuth2TokenContext.getTokenType() is not supported. |
void |
setAccessTokenCustomizer(OAuth2TokenCustomizer<OAuth2TokenClaimsContext> accessTokenCustomizer)
|
@Nullable public org.springframework.security.oauth2.core.OAuth2AccessToken generate(OAuth2TokenContext context)
OAuth2TokenGeneratorOAuth2TokenContext,
or return null if the OAuth2TokenContext.getTokenType() is not supported.
If the returned OAuth2Token has a set of claims, it should implement ClaimAccessor
in order for it to be stored with the OAuth2Authorization.
generate in interface OAuth2TokenGenerator<org.springframework.security.oauth2.core.OAuth2AccessToken>context - the context containing the OAuth 2.0 Token attributesOAuth2Token or null if the OAuth2TokenContext.getTokenType() is not supportedpublic void setAccessTokenCustomizer(OAuth2TokenCustomizer<OAuth2TokenClaimsContext> accessTokenCustomizer)
accessTokenCustomizer - the OAuth2TokenCustomizer that customizes the claims for the OAuth2AccessToken