Class AuthoritiesAccessTokenEnhancer
java.lang.Object
com.broadleafcommerce.auth.user.session.token.enhancer.AuthoritiesAccessTokenEnhancer
- All Implemented Interfaces:
JwtAccessTokenEnhancer,org.springframework.core.Ordered
A
JwtAccessTokenEnhancer to add the "authorities" claim.- Author:
- Cade Rea (cade-rea)
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAuthoritiesAccessTokenEnhancer(SecurityService securityService, TokenEnhancerUtility tokenEnhancerUtility) -
Method Summary
Modifier and TypeMethodDescriptionvoidenhance(JwtTokenEnhancerContext context) Evaluate the authentication and add claims as necessary.protected Collection<String>Get all permissions that are available to the given authorized context.intgetOrder()protected SecurityServiceprotected TokenEnhancerUtility
-
Constructor Details
-
AuthoritiesAccessTokenEnhancer
public AuthoritiesAccessTokenEnhancer(SecurityService securityService, TokenEnhancerUtility tokenEnhancerUtility)
-
-
Method Details
-
enhance
Description copied from interface:JwtAccessTokenEnhancerEvaluate the authentication and add claims as necessary. AJwtTokenEnhancerContextcontains User and client authentication tokens, authorization tokens, and access token claims.- Specified by:
enhancein interfaceJwtAccessTokenEnhancer- Parameters:
context- TheJwtTokenEnhancerContextto evaluate.
-
getAllAvailablePermissions
Get all permissions that are available to the given authorized context.- Parameters:
context- TheJwtTokenEnhancerContextcontaining the current authorization data.- Returns:
- A Collection<String> of all permissions available to the given
JwtTokenEnhancerContext. - See Also:
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceJwtAccessTokenEnhancer- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
getSecurityService
-
getTokenEnhancerUtility
-