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:
- 7.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. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key used for the DPoP ProofJwt(if available). -
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable OAuth2AuthorizationReturns theauthorization.default <T extends org.springframework.security.core.Authentication>
@Nullable TReturns theAuthenticationrepresenting the authorization grant.default @Nullable 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>
@Nullable TReturns theAuthenticationrepresenting thePrincipalresource owner (or client).default RegisteredClientReturns theregistered client.default OAuth2TokenTypeReturns thetoken type.
-
Field Details
-
DPOP_PROOF_KEY
The key used for the DPoP ProofJwt(if available).
-
-
Method Details
-
getRegisteredClient
Returns theregistered client.- Returns:
- the
RegisteredClient
-
getPrincipal
default <T extends org.springframework.security.core.Authentication> @Nullable T getPrincipal()Returns theAuthenticationrepresenting thePrincipalresource owner (or client).- Type Parameters:
T- the type of theAuthentication- Returns:
- the
Authenticationrepresenting thePrincipalresource owner (or client), ornullif not available
-
getAuthorizationServerContext
Returns theauthorization server context.- Returns:
- the
AuthorizationServerContext
-
getAuthorization
Returns theauthorization.- Returns:
- the
OAuth2Authorization, ornullif not available
-
getAuthorizedScopes
-
getTokenType
-
getAuthorizationGrantType
default @Nullable org.springframework.security.oauth2.core.AuthorizationGrantType getAuthorizationGrantType()Returns theauthorization grant type.- Returns:
- the
AuthorizationGrantType, ornullif not available
-
getAuthorizationGrant
default <T extends org.springframework.security.core.Authentication> @Nullable T getAuthorizationGrant()Returns theAuthenticationrepresenting the authorization grant.- Type Parameters:
T- the type of theAuthentication- Returns:
- the
Authenticationrepresenting the authorization grant, ornullif not available
-