Class AccountIdAccessTokenEnhancer
java.lang.Object
com.broadleafcommerce.auth.user.session.token.enhancer.AbstractUserAccessTokenEnhancer
com.broadleafcommerce.auth.user.session.token.enhancer.AccountIdAccessTokenEnhancer
- All Implemented Interfaces:
- JwtAccessTokenEnhancer,- org.springframework.core.Ordered
Responsible for validating and adding the "acct_id" claim to the token. A user is defined as a
 member of an account if they have at least one role for that account.
- 
Field SummaryFieldsFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionAccountIdAccessTokenEnhancer(UserService<User> userService, TokenEnhancerUtility tokenEnhancerUtility, AccountAncestorService accountAncestorService) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidenhance(JwtTokenEnhancerContext context) Evaluate the authentication and add claims as necessary.protected AccountAncestorServiceLooks for an account ID on the request.Methods inherited from class com.broadleafcommerce.auth.user.session.token.enhancer.AbstractUserAccessTokenEnhancergetSessionToken, getTokenEnhancerUtility, getUser, getUserService, isAnonymousCsrImpersonation, isClientOnly, shouldEnhanceMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.auth.user.session.token.enhancer.JwtAccessTokenEnhancergetOrder
- 
Field Details- 
ACCOUNT_ID_CLAIM- See Also:
 
- 
PARENT_ACCOUNTS_CLAIM- See Also:
 
- 
PERSONAL- See Also:
 
 
- 
- 
Constructor Details- 
AccountIdAccessTokenEnhancerpublic AccountIdAccessTokenEnhancer(UserService<User> userService, TokenEnhancerUtility tokenEnhancerUtility, AccountAncestorService accountAncestorService) 
 
- 
- 
Method Details- 
enhanceDescription copied from interface:JwtAccessTokenEnhancerEvaluate the authentication and add claims as necessary. AJwtTokenEnhancerContextcontains User and client authentication tokens, authorization tokens, and access token claims.- Parameters:
- context- The- JwtTokenEnhancerContextto evaluate.
 
- 
getRequestAccountIdLooks for an account ID on the request. If it exists, it is returned. Otherwise, if the user has adefault account ID, that is returned.- Parameters:
- context- The- JwtTokenEnhancerContextobject passed to- JwtAccessTokenEnhancer.enhance(JwtTokenEnhancerContext).
- Returns:
- The accountId requested or Optional.empty().
 
- 
getAccountAncestorService
 
-