Class UserAccessTokenEnhancer

java.lang.Object
com.broadleafcommerce.auth.user.session.token.enhancer.AbstractUserAccessTokenEnhancer
com.broadleafcommerce.auth.user.session.token.enhancer.UserAccessTokenEnhancer
All Implemented Interfaces:
JwtAccessTokenEnhancer, org.springframework.core.Ordered

public class UserAccessTokenEnhancer extends AbstractUserAccessTokenEnhancer
Token enhancer that puts various relevant user data into the token's claims.
Author:
Samarth Dhruva (samarthd), Nick Crum (ncrum)
  • Constructor Details

  • Method Details

    • enhance

      public void enhance(JwtTokenEnhancerContext context)
      Description copied from interface: JwtAccessTokenEnhancer
      Evaluate the authentication and add claims as necessary. A JwtTokenEnhancerContext contains User and client authentication tokens, authorization tokens, and access token claims.
      Parameters:
      context - The JwtTokenEnhancerContext to evaluate.
    • getUserTokenClaims

      protected Map<String,Object> getUserTokenClaims(JwtTokenEnhancerContext context)
    • putServiceIdClaim

      protected void putServiceIdClaim(Map<String,Object> userData, User user)
    • getAdditionalAttributeClaims

      protected Map<String,Object> getAdditionalAttributeClaims(@NonNull @NonNull User user)
      If the user type is known, then this will check UserMappingProperties for any additional attributes that have been mapped onto the User that should be included as a claim.

      By default, this will only check customer-user-sourced attributes.

      Parameters:
      user - The authenticated user.
      Returns:
      The additional attributes that should be included as claims.
    • getUserMappingProperties

      protected UserMappingProperties getUserMappingProperties()
    • setUserMappingProperties

      @Autowired public void setUserMappingProperties(UserMappingProperties userMappingProperties)