Class RegisteredClaimsTokenEnhancer
- java.lang.Object
- 
- com.broadleafcommerce.auth.user.session.token.enhancer.RegisteredClaimsTokenEnhancer
 
- 
- All Implemented Interfaces:
- org.springframework.security.oauth2.provider.token.TokenEnhancer
 
 public class RegisteredClaimsTokenEnhancer extends Object implements org.springframework.security.oauth2.provider.token.TokenEnhancer Token enhancer that adds several registered JWT claims, such as issuer and audience, as well as a non-standard "max" claim that determines the maximum lifetime of a token.The max claim differs from "exp" in that it determines the maximum lifetime of a session. The default is 720 minutes (12 hours), but this may be configured via the property broadleaf.auth.session.maxDurationMinutes - Author:
- Samarth Dhruva (samarthd)
 
- 
- 
Constructor SummaryConstructors Constructor Description RegisteredClaimsTokenEnhancer(String issuer, List<String> audiences)RegisteredClaimsTokenEnhancer(String issuer, List<String> audiences, int maxSessionDurationMinutes)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.oauth2.common.OAuth2AccessTokenenhance(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken, org.springframework.security.oauth2.provider.OAuth2Authentication authentication)Places various claims into the additional information of the access token, including the issuer, audience, and max lifetime.protected List<String>getAudiences()protected StringgetIssuer()protected DurationgetMaxSessionDurationMinutes()
 
- 
- 
- 
Method Detail- 
enhancepublic org.springframework.security.oauth2.common.OAuth2AccessToken enhance(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken, org.springframework.security.oauth2.provider.OAuth2Authentication authentication)Places various claims into the additional information of the access token, including the issuer, audience, and max lifetime.Do note that "oauth2-resource"is placed into the audience claim, asOAuth2AuthenticationManager.authenticate(Authentication)explicitly checks for its presence as aresourceIdwhen processing requests.- Specified by:
- enhancein interface- org.springframework.security.oauth2.provider.token.TokenEnhancer
 
 - 
getIssuerprotected String getIssuer() 
 - 
getMaxSessionDurationMinutesprotected Duration getMaxSessionDurationMinutes() 
 
- 
 
-