Class JwtTokenEnhancerContext

java.lang.Object
com.broadleafcommerce.auth.user.session.token.enhancer.JwtTokenEnhancerContext

public class JwtTokenEnhancerContext extends Object
A wrapper for JwtEncodingContext that includes a map for additional context.
Author:
Cade Rea (cade-rea)
  • Constructor Details

    • JwtTokenEnhancerContext

      public JwtTokenEnhancerContext(org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext jwtEncodingContext)
  • Method Details

    • getAdditionalContext

      @Nullable public <V> V getAdditionalContext(String key)
    • hasAdditionalContextKey

      public boolean hasAdditionalContextKey(String key)
    • getJwtEncodingContext

      public org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext getJwtEncodingContext()
      The JwtEncodingContext created by an AuthenticationProvider in the OAuth2TokenEndpointFilter. This context contains User and client authentication tokens, authorization tokens, and access token claims.
      See Also:
      • OAuth2AuthorizationCodeAuthenticationProvider
      • OAuth2ClientCredentialsAuthenticationProvider
    • getAdditionalContext

      public Map<String,Object> getAdditionalContext()
      Arbitrary map that can be used by enhancer implementations to pass and share information (ex: from earlier-precedence enhancers to later, downstream enhancers) between each other without affecting jwtEncodingContext. This value is entirely an implementation detail and can contain arbitrary data - it's up to enhancers how to use this information to populate the final token.
    • get

      public <V> V get(Object key)
    • hasKey

      public boolean hasKey(Object key)
    • getJwsHeader

      public org.springframework.security.oauth2.jwt.JwsHeader.Builder getJwsHeader()
    • getClaims

      public org.springframework.security.oauth2.jwt.JwtClaimsSet.Builder getClaims()
    • getRegisteredClient

      public org.springframework.security.oauth2.server.authorization.client.RegisteredClient getRegisteredClient()
    • getPrincipal

      public <T extends org.springframework.security.core.Authentication> T getPrincipal()
    • getAuthorizationServerContext

      public org.springframework.security.oauth2.server.authorization.context.AuthorizationServerContext getAuthorizationServerContext()
    • getAuthorization

      public org.springframework.security.oauth2.server.authorization.OAuth2Authorization getAuthorization()
    • getAuthorizedScopes

      public Set<String> getAuthorizedScopes()
    • getTokenType

      public org.springframework.security.oauth2.server.authorization.OAuth2TokenType getTokenType()
    • getAuthorizationGrantType

      public org.springframework.security.oauth2.core.AuthorizationGrantType getAuthorizationGrantType()
    • getAuthorizationGrant

      public <T extends org.springframework.security.core.Authentication> T getAuthorizationGrant()
    • get

      public <V> V get(Class<V> key)