Class DefaultOAuth2SessionToken
- java.lang.Object
-
- com.broadleafcommerce.auth.user.session.DefaultOAuth2SessionToken
-
- All Implemented Interfaces:
OAuth2SessionToken
,Serializable
public class DefaultOAuth2SessionToken extends Object implements Serializable, OAuth2SessionToken
AnOAuth2SessionToken
that holds the claims within aHashMap
.- Author:
- Nick Crum (ncrum)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultOAuth2SessionToken(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
Map<String,Object>
getClaims()
String
getClientId()
String
getCsrClientId()
Collection<? extends org.springframework.security.core.GrantedAuthority>
getCsrInheritedAuthorities()
String
getCsrSubject()
String
getCsrUserId()
Date
getExpiresIn()
Date
getMaxExpiresIn()
String
getSubject()
String
getUserId()
String
getValue()
int
hashCode()
boolean
isCsrAnonymous()
boolean
isImpersonated()
void
setClaims(Map<String,Object> claims)
void
setClientId(String clientId)
void
setCsrClientId(String csrClientId)
void
setCsrSubject(String csrSubject)
void
setCsrUserId(String csrUserId)
void
setExpiresIn(Date expiresIn)
void
setMaxExpiresIn(Date maxExpiresIn)
void
setSubject(String subject)
void
setUserId(String userId)
void
setValue(String value)
String
toString()
-
-
-
Constructor Detail
-
DefaultOAuth2SessionToken
public DefaultOAuth2SessionToken(String value)
Create a session token from the value provided.
-
DefaultOAuth2SessionToken
public DefaultOAuth2SessionToken(String value, Map<String,Object> claims)
Create a session token from the value provided and extracted claims.
-
DefaultOAuth2SessionToken
public DefaultOAuth2SessionToken(OAuth2SessionToken sessionToken)
Copy constructor for session token.
-
-
Method Detail
-
getUserId
public String getUserId()
- Specified by:
getUserId
in interfaceOAuth2SessionToken
-
setUserId
public void setUserId(String userId)
-
getSubject
public String getSubject()
- Specified by:
getSubject
in interfaceOAuth2SessionToken
- Returns:
- the user subject.
-
setSubject
public void setSubject(String subject)
-
getClientId
public String getClientId()
- Specified by:
getClientId
in interfaceOAuth2SessionToken
- Returns:
- the client ID
-
setClientId
public void setClientId(String clientId)
-
getExpiresIn
public Date getExpiresIn()
- Specified by:
getExpiresIn
in interfaceOAuth2SessionToken
- Returns:
- the expires in date
-
setExpiresIn
public void setExpiresIn(Date expiresIn)
-
getMaxExpiresIn
public Date getMaxExpiresIn()
- Specified by:
getMaxExpiresIn
in interfaceOAuth2SessionToken
- Returns:
- the max expires in date
-
setMaxExpiresIn
public void setMaxExpiresIn(Date maxExpiresIn)
-
isImpersonated
public boolean isImpersonated()
- Specified by:
isImpersonated
in interfaceOAuth2SessionToken
- Returns:
- true if this is an impersonated session, else false.
-
getCsrClientId
public String getCsrClientId()
- Specified by:
getCsrClientId
in interfaceOAuth2SessionToken
- Returns:
- The CSR client ID if this is an impersonated session, or null.
- See Also:
OAuth2SessionToken.isImpersonated()
-
setCsrClientId
public void setCsrClientId(String csrClientId)
-
getCsrSubject
public String getCsrSubject()
- Specified by:
getCsrSubject
in interfaceOAuth2SessionToken
- Returns:
- the CSR subject if this is an impersonated session, or null.
-
setCsrSubject
public void setCsrSubject(String csrSubject)
-
getCsrUserId
public String getCsrUserId()
- Specified by:
getCsrUserId
in interfaceOAuth2SessionToken
- Returns:
- the CSR user ID if this is an impersonated session, or null.
-
setCsrUserId
public void setCsrUserId(String csrUserId)
-
isCsrAnonymous
public boolean isCsrAnonymous()
- Specified by:
isCsrAnonymous
in interfaceOAuth2SessionToken
- Returns:
- true if this is an anonymous impersonated session, else false.
-
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
public String getValue()
- Specified by:
getValue
in interfaceOAuth2SessionToken
- Returns:
- the serialized session token value. Typically a JWT.
-
getClaims
public Map<String,Object> getClaims()
- Specified by:
getClaims
in interfaceOAuth2SessionToken
- Returns:
- Claims associated with this session token.
-
setValue
public void setValue(String value)
-
canEqual
protected boolean canEqual(Object other)
-
-