Interface OAuth2TokenGenerator<T extends org.springframework.security.oauth2.core.OAuth2Token>
- Type Parameters:
T- the type of the OAuth 2.0 Token
- All Known Implementing Classes:
DelegatingOAuth2TokenGenerator,JwtGenerator,OAuth2AccessTokenGenerator,OAuth2RefreshTokenGenerator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface OAuth2TokenGenerator<T extends org.springframework.security.oauth2.core.OAuth2Token>
Implementations of this interface are responsible for generating an
OAuth2Token
using the attributes contained in the OAuth2TokenContext.- Since:
- 0.2.3
- See Also:
-
OAuth2TokenOAuth2TokenContextOAuth2TokenClaimsSetClaimAccessor
-
Method Summary
Modifier and TypeMethodDescriptiongenerate(OAuth2TokenContext context) Generate an OAuth 2.0 Token using the attributes contained in theOAuth2TokenContext, or returnnullif theOAuth2TokenContext.getTokenType()is not supported.
-
Method Details
-
generate
Generate an OAuth 2.0 Token using the attributes contained in theOAuth2TokenContext, or returnnullif theOAuth2TokenContext.getTokenType()is not supported.If the returned
OAuth2Tokenhas a set of claims, it should implementClaimAccessorin order for it to be stored with theOAuth2Authorization.- Parameters:
context- the context containing the OAuth 2.0 Token attributes- Returns:
- an
OAuth2Tokenornullif theOAuth2TokenContext.getTokenType()is not supported
-