Class UserRestrictionAccessTokenEnhancer

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

public class UserRestrictionAccessTokenEnhancer extends AbstractUserAccessTokenEnhancer
Token enhancer that includes user restrictions and restricted authorities within the token.
Author:
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.
    • getRestrictedAuthoritiesInScopes

      protected Map<String,Map<String,Set<String>>> getRestrictedAuthoritiesInScopes(Map<String,Map<String,Set<String>>> restrictionTypeAndTargetsByPermissionName, Set<String> scopes)
      Gets the restricted authorities that are in scope.
      Parameters:
      restrictionTypeAndTargetsByPermissionName - a map of restricted authorities
      scopes - Scopes to filter the restricted authorities by
      Returns:
      a map of restricted authorities that are in the given scopes
    • getUserDetails

      @Nullable protected OAuth2UserDetails getUserDetails(org.springframework.security.core.Authentication sessionToken)
    • isSupportedUserDetails

      protected boolean isSupportedUserDetails(Object principal)
    • getPermissionRepository

      protected PermissionRepository getPermissionRepository()
    • getSecurityService

      protected SecurityService getSecurityService()