Class DefaultOAuth2SessionToken
java.lang.Object
com.broadleafcommerce.auth.user.session.DefaultOAuth2SessionToken
- All Implemented Interfaces:
OAuth2SessionToken,Serializable
An
OAuth2SessionToken that holds the claims within a HashMap.- Author:
- Nick Crum (ncrum)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultOAuth2SessionToken(OAuth2SessionToken sessionToken) Copy constructor for session token.DefaultOAuth2SessionToken(String value) Create a session token from the value provided.DefaultOAuth2SessionToken(String value, Map<String, Object> claims) Create a session token from the value provided and extracted claims. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanCollection<? extends org.springframework.security.core.GrantedAuthority>getValue()inthashCode()booleanbooleanbooleanvoidvoidsetClientId(String clientId) voidsetCsrClientId(String csrClientId) voidsetCsrSubject(String csrSubject) voidsetCsrUserId(String csrUserId) voidsetExpiresIn(Date expiresIn) voidsetImpersonatingSelf(Boolean impersonatingSelf) voidsetMaxExpiresIn(Date maxExpiresIn) voidsetSubject(String subject) voidvoidtoString()
-
Constructor Details
-
DefaultOAuth2SessionToken
Create a session token from the value provided. -
DefaultOAuth2SessionToken
Create a session token from the value provided and extracted claims. -
DefaultOAuth2SessionToken
Copy constructor for session token.
-
-
Method Details
-
getUserId
- Specified by:
getUserIdin interfaceOAuth2SessionToken
-
setUserId
-
getSubject
- Specified by:
getSubjectin interfaceOAuth2SessionToken- Returns:
- the user subject.
-
setSubject
-
getClientId
- Specified by:
getClientIdin interfaceOAuth2SessionToken- Returns:
- the client ID
-
setClientId
-
getExpiresIn
- Specified by:
getExpiresInin interfaceOAuth2SessionToken- Returns:
- the expires in date
-
setExpiresIn
-
getMaxExpiresIn
- Specified by:
getMaxExpiresInin interfaceOAuth2SessionToken- Returns:
- the max expires in date
-
setMaxExpiresIn
-
isImpersonated
public boolean isImpersonated()- Specified by:
isImpersonatedin interfaceOAuth2SessionToken- Returns:
- true if this is an impersonated session, else false.
-
getCsrClientId
- Specified by:
getCsrClientIdin interfaceOAuth2SessionToken- Returns:
- The CSR client ID if this is an impersonated session, or null.
- See Also:
-
setCsrClientId
-
getCsrSubject
- Specified by:
getCsrSubjectin interfaceOAuth2SessionToken- Returns:
- the CSR subject if this is an impersonated session, or null.
-
setCsrSubject
-
getCsrUserId
- Specified by:
getCsrUserIdin interfaceOAuth2SessionToken- Returns:
- the CSR user ID if this is an impersonated session, or null.
-
setCsrUserId
-
setImpersonatingSelf
-
isImpersonatingSelf
public boolean isImpersonatingSelf()- Specified by:
isImpersonatingSelfin interfaceOAuth2SessionToken- See Also:
-
isCsrAnonymous
public boolean isCsrAnonymous()- Specified by:
isCsrAnonymousin interfaceOAuth2SessionToken- Returns:
- true if this is an anonymous impersonated session, else false.
-
setClaims
-
getCsrInheritedAuthorities
public Collection<? extends org.springframework.security.core.GrantedAuthority> getCsrInheritedAuthorities()- Specified by:
getCsrInheritedAuthoritiesin interfaceOAuth2SessionToken- Returns:
- The inherited authorities from a CSR if this is an impersonated session, or null.
-
getValue
- Specified by:
getValuein interfaceOAuth2SessionToken- Returns:
- the serialized session token value. Typically a JWT.
-
getClaims
- Specified by:
getClaimsin interfaceOAuth2SessionToken- Returns:
- Claims associated with this session token.
-
setValue
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-