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
ConstructorDescriptionDefaultOAuth2SessionToken
(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 boolean
boolean
Collection<? extends org.springframework.security.core.GrantedAuthority>
getValue()
int
hashCode()
boolean
boolean
boolean
void
void
setClientId
(String clientId) void
setCsrClientId
(String csrClientId) void
setCsrSubject
(String csrSubject) void
setCsrUserId
(String csrUserId) void
setExpiresIn
(Date expiresIn) void
setImpersonatingSelf
(Boolean impersonatingSelf) void
setMaxExpiresIn
(Date maxExpiresIn) void
setSubject
(String subject) void
void
toString()
-
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:
getUserId
in interfaceOAuth2SessionToken
-
setUserId
-
getSubject
- Specified by:
getSubject
in interfaceOAuth2SessionToken
- Returns:
- the user subject.
-
setSubject
-
getClientId
- Specified by:
getClientId
in interfaceOAuth2SessionToken
- Returns:
- the client ID
-
setClientId
-
getExpiresIn
- Specified by:
getExpiresIn
in interfaceOAuth2SessionToken
- Returns:
- the expires in date
-
setExpiresIn
-
getMaxExpiresIn
- Specified by:
getMaxExpiresIn
in interfaceOAuth2SessionToken
- Returns:
- the max expires in date
-
setMaxExpiresIn
-
isImpersonated
public boolean isImpersonated()- Specified by:
isImpersonated
in interfaceOAuth2SessionToken
- Returns:
- true if this is an impersonated session, else false.
-
getCsrClientId
- Specified by:
getCsrClientId
in interfaceOAuth2SessionToken
- Returns:
- The CSR client ID if this is an impersonated session, or null.
- See Also:
-
setCsrClientId
-
getCsrSubject
- Specified by:
getCsrSubject
in interfaceOAuth2SessionToken
- Returns:
- the CSR subject if this is an impersonated session, or null.
-
setCsrSubject
-
getCsrUserId
- Specified by:
getCsrUserId
in interfaceOAuth2SessionToken
- Returns:
- the CSR user ID if this is an impersonated session, or null.
-
setCsrUserId
-
setImpersonatingSelf
-
isImpersonatingSelf
public boolean isImpersonatingSelf()- Specified by:
isImpersonatingSelf
in interfaceOAuth2SessionToken
- See Also:
-
isCsrAnonymous
public boolean isCsrAnonymous()- Specified by:
isCsrAnonymous
in 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:
getCsrInheritedAuthorities
in interfaceOAuth2SessionToken
- Returns:
- The inherited authorities from a CSR if this is an impersonated session, or null.
-
getValue
- Specified by:
getValue
in interfaceOAuth2SessionToken
- Returns:
- the serialized session token value. Typically a JWT.
-
getClaims
- Specified by:
getClaims
in interfaceOAuth2SessionToken
- Returns:
- Claims associated with this session token.
-
setValue
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-