Interface OAuth2TokenContext
- All Superinterfaces:
Context
- All Known Implementing Classes:
DefaultOAuth2TokenContext,JwtEncodingContext,OAuth2TokenClaimsContext
A context that holds information (to be) associated to an OAuth 2.0 Token and is used
by an
OAuth2TokenGenerator and OAuth2TokenCustomizer.- Since:
- 0.1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classOAuth2TokenContext.AbstractBuilder<T extends OAuth2TokenContext,B extends OAuth2TokenContext.AbstractBuilder<T, B>> Base builder for implementations ofOAuth2TokenContext. -
Method Summary
Modifier and TypeMethodDescriptiondefault OAuth2AuthorizationReturns theauthorization.default <T extends org.springframework.security.core.Authentication>
TReturns theAuthenticationrepresenting the authorization grant.default org.springframework.security.oauth2.core.AuthorizationGrantTypeReturns theauthorization grant type.default AuthorizationServerContextReturns theauthorization server context.Returns the authorized scope(s).default <T extends org.springframework.security.core.Authentication>
TReturns theAuthenticationrepresenting thePrincipalresource owner (or client).default RegisteredClientReturns theregistered client.default OAuth2TokenTypeReturns thetoken type.
-
Method Details
-
getRegisteredClient
Returns theregistered client.- Returns:
- the
RegisteredClient
-
getPrincipal
default <T extends org.springframework.security.core.Authentication> T getPrincipal()Returns theAuthenticationrepresenting thePrincipalresource owner (or client).- Type Parameters:
T- the type of theAuthentication- Returns:
- the
Authenticationrepresenting thePrincipalresource owner (or client)
-
getAuthorizationServerContext
Returns theauthorization server context.- Returns:
- the
AuthorizationServerContext - Since:
- 0.2.3
-
getAuthorization
Returns theauthorization.- Returns:
- the
OAuth2Authorization, ornullif not available
-
getAuthorizedScopes
Returns the authorized scope(s).- Returns:
- the authorized scope(s)
-
getTokenType
Returns thetoken type.- Returns:
- the
OAuth2TokenType
-
getAuthorizationGrantType
default org.springframework.security.oauth2.core.AuthorizationGrantType getAuthorizationGrantType()Returns theauthorization grant type.- Returns:
- the
AuthorizationGrantType
-
getAuthorizationGrant
default <T extends org.springframework.security.core.Authentication> T getAuthorizationGrant()Returns theAuthenticationrepresenting the authorization grant.- Type Parameters:
T- the type of theAuthentication- Returns:
- the
Authenticationrepresenting the authorization grant
-