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
Modifier and TypeInterfaceDescriptionstatic class
OAuth2TokenContext.AbstractBuilder<T extends OAuth2TokenContext,
B extends OAuth2TokenContext.AbstractBuilder<T, B>> Base builder for implementations ofOAuth2TokenContext
. -
Method Summary
Modifier and TypeMethodDescriptiondefault OAuth2Authorization
Returns theauthorization
.default <T extends org.springframework.security.core.Authentication>
TReturns theAuthentication
representing the authorization grant.default org.springframework.security.oauth2.core.AuthorizationGrantType
Returns theauthorization grant type
.default AuthorizationServerContext
Returns theauthorization server context
.Returns the authorized scope(s).default <T extends org.springframework.security.core.Authentication>
TReturns theAuthentication
representing thePrincipal
resource owner (or client).default RegisteredClient
Returns theregistered client
.default OAuth2TokenType
Returns thetoken type
.
-
Method Details
-
getRegisteredClient
Returns theregistered client
.- Returns:
- the
RegisteredClient
-
getPrincipal
default <T extends org.springframework.security.core.Authentication> T getPrincipal()Returns theAuthentication
representing thePrincipal
resource owner (or client).- Type Parameters:
T
- the type of theAuthentication
- Returns:
- the
Authentication
representing thePrincipal
resource owner (or client)
-
getAuthorizationServerContext
Returns theauthorization server context
.- Returns:
- the
AuthorizationServerContext
- Since:
- 0.2.3
-
getAuthorization
Returns theauthorization
.- Returns:
- the
OAuth2Authorization
, ornull
if 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 theAuthentication
representing the authorization grant.- Type Parameters:
T
- the type of theAuthentication
- Returns:
- the
Authentication
representing the authorization grant
-