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
ConstructorDescriptionAuthoritiesAccessTokenEnhancer
(SecurityService securityService, TokenEnhancerUtility tokenEnhancerUtility) -
Method Summary
Modifier and TypeMethodDescriptionvoid
enhance
(JwtTokenEnhancerContext context) Evaluate the authentication and add claims as necessary.protected Collection<String>
Get all permissions that are available to the given authorized context.int
getOrder()
protected SecurityService
protected TokenEnhancerUtility
-
Constructor Details
-
AuthoritiesAccessTokenEnhancer
public AuthoritiesAccessTokenEnhancer(SecurityService securityService, TokenEnhancerUtility tokenEnhancerUtility)
-
-
Method Details
-
enhance
Description copied from interface:JwtAccessTokenEnhancer
Evaluate the authentication and add claims as necessary. AJwtTokenEnhancerContext
contains User and client authentication tokens, authorization tokens, and access token claims.- Specified by:
enhance
in interfaceJwtAccessTokenEnhancer
- Parameters:
context
- TheJwtTokenEnhancerContext
to evaluate.
-
getAllAvailablePermissions
Get all permissions that are available to the given authorized context.- Parameters:
context
- TheJwtTokenEnhancerContext
containing the current authorization data.- Returns:
- A Collection<String> of all permissions available to the given
JwtTokenEnhancerContext
. - See Also:
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceJwtAccessTokenEnhancer
- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
getSecurityService
-
getTokenEnhancerUtility
-