public class DefaultOAuth2AccessToken extends Object implements Serializable, OAuth2AccessToken
ACCESS_TOKEN, BEARER_TYPE, EXPIRES_IN, OAUTH2_TYPE, REFRESH_TOKEN, SCOPE, TOKEN_TYPE
Constructor and Description |
---|
DefaultOAuth2AccessToken(OAuth2AccessToken accessToken)
Copy constructor for access token.
|
DefaultOAuth2AccessToken(String value)
Create an access token from the value provided.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Map<String,Object> |
getAdditionalInformation()
Additional information that token granters would like to add to the token, e.g. to support new token types.
|
Date |
getExpiration()
The instant the token expires.
|
int |
getExpiresIn() |
OAuth2RefreshToken |
getRefreshToken()
The refresh token associated with the access token, if any.
|
Set<String> |
getScope()
The scope of the token.
|
String |
getTokenType()
The token type, as introduced in draft 11 of the OAuth 2 spec.
|
String |
getValue()
The token value.
|
int |
hashCode() |
boolean |
isExpired()
Convenience method for checking expiration
|
void |
setAdditionalInformation(Map<String,Object> additionalInformation)
Additional information that token granters would like to add to the token, e.g. to support new token types.
|
void |
setExpiration(Date expiration)
The instant the token expires.
|
protected void |
setExpiresIn(int delta) |
void |
setRefreshToken(OAuth2RefreshToken refreshToken)
The refresh token associated with the access token, if any.
|
void |
setScope(Set<String> scope)
The scope of the token.
|
void |
setTokenType(String tokenType)
The token type, as introduced in draft 11 of the OAuth 2 spec.
|
void |
setValue(String value) |
String |
toString() |
static OAuth2AccessToken |
valueOf(Map<String,String> tokenParams) |
public DefaultOAuth2AccessToken(String value)
public DefaultOAuth2AccessToken(OAuth2AccessToken accessToken)
accessToken
- public void setValue(String value)
public String getValue()
getValue
in interface OAuth2AccessToken
public int getExpiresIn()
getExpiresIn
in interface OAuth2AccessToken
protected void setExpiresIn(int delta)
public Date getExpiration()
getExpiration
in interface OAuth2AccessToken
public void setExpiration(Date expiration)
expiration
- The instant the token expires.public boolean isExpired()
isExpired
in interface OAuth2AccessToken
public String getTokenType()
getTokenType
in interface OAuth2AccessToken
public void setTokenType(String tokenType)
tokenType
- The token type, as introduced in draft 11 of the OAuth 2 spec.public OAuth2RefreshToken getRefreshToken()
getRefreshToken
in interface OAuth2AccessToken
public void setRefreshToken(OAuth2RefreshToken refreshToken)
refreshToken
- The refresh token associated with the access token, if any.public Set<String> getScope()
getScope
in interface OAuth2AccessToken
public void setScope(Set<String> scope)
scope
- The scope of the token.public static OAuth2AccessToken valueOf(Map<String,String> tokenParams)
public Map<String,Object> getAdditionalInformation()
getAdditionalInformation
in interface OAuth2AccessToken
public void setAdditionalInformation(Map<String,Object> additionalInformation)
additionalInformation
- the additional information to setCopyright © 2019. All rights reserved.