All Superinterfaces:
Context
All Known Implementing Classes:
DefaultOAuth2TokenContext, JwtEncodingContext, OAuth2TokenClaimsContext

public interface OAuth2TokenContext extends Context
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:
  • Method Details

    • getRegisteredClient

      default RegisteredClient getRegisteredClient()
      Returns the registered client.
      Returns:
      the RegisteredClient
    • getPrincipal

      default <T extends org.springframework.security.core.Authentication> T getPrincipal()
      Returns the Authentication representing the Principal resource owner (or client).
      Type Parameters:
      T - the type of the Authentication
      Returns:
      the Authentication representing the Principal resource owner (or client)
    • getAuthorizationServerContext

      default AuthorizationServerContext getAuthorizationServerContext()
      Returns:
      the AuthorizationServerContext
      Since:
      0.2.3
    • getAuthorization

      @Nullable default OAuth2Authorization getAuthorization()
      Returns the authorization.
      Returns:
      the OAuth2Authorization, or null if not available
    • getAuthorizedScopes

      default Set<String> getAuthorizedScopes()
      Returns the authorized scope(s).
      Returns:
      the authorized scope(s)
    • getTokenType

      default OAuth2TokenType getTokenType()
      Returns the token type.
      Returns:
      the OAuth2TokenType
    • getAuthorizationGrantType

      default org.springframework.security.oauth2.core.AuthorizationGrantType getAuthorizationGrantType()
      Returns the authorization grant type.
      Returns:
      the AuthorizationGrantType
    • getAuthorizationGrant

      default <T extends org.springframework.security.core.Authentication> T getAuthorizationGrant()
      Returns the Authentication representing the authorization grant.
      Type Parameters:
      T - the type of the Authentication
      Returns:
      the Authentication representing the authorization grant