public class RegisteredClaimsTokenEnhancer extends Object implements org.springframework.security.oauth2.provider.token.TokenEnhancer
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
Constructor and Description |
---|
RegisteredClaimsTokenEnhancer(String issuer,
List<String> audiences) |
RegisteredClaimsTokenEnhancer(String issuer,
List<String> audiences,
int maxSessionDurationMinutes) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected List<String> |
getAudiences() |
protected String |
getIssuer() |
protected Duration |
getMaxSessionDurationMinutes() |
public RegisteredClaimsTokenEnhancer(String issuer, List<String> audiences, int maxSessionDurationMinutes)
public org.springframework.security.oauth2.common.OAuth2AccessToken enhance(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken, org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
Do note that "oauth2-resource"
is placed into the audience claim, as
OAuth2AuthenticationManager.authenticate(Authentication)
explicitly checks for its
presence as a resourceId
when processing requests.
enhance
in interface org.springframework.security.oauth2.provider.token.TokenEnhancer
protected String getIssuer()
protected Duration getMaxSessionDurationMinutes()
Copyright © 2021. All rights reserved.