public class AccessToken extends Object implements ParametersMap
| Constructor and Description |
|---|
AccessToken(Map<String,Object> map)
Initialize from map of properties such as "access_token" and "expires_in".
|
AccessToken(String accessToken,
String tokenType,
long expiresIn,
String refreshToken,
Collection<String> scopes)
Initializes an oauth token object from standard properties.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessToken()
Returns the "access_token" string in this oauth token.
|
long |
getExpiresIn()
Returns the "expires_in" number in this access token.
|
protected static Map<String,String> |
getPropertyMap()
Maps Bean introspection property descriptors name to OAuth2 valid payload
property names.
|
String |
getRefreshToken()
Returns the "refresh_token" string in this oauth token.
|
Collection<String> |
getScopes()
Returns the "scope" in this oauth token, modeled as collection of scope strings.
|
String |
getTokenType()
Returns the "token_type" string in this oauth token.
|
boolean |
hasScope(String scope)
Checks if scope is one of the configured scopes for this access token.
|
Map<String,Object> |
map()
Returns the properties of this token object as map.
|
String |
toString() |
public AccessToken(String accessToken, String tokenType, long expiresIn, String refreshToken, Collection<String> scopes)
accessToken - the "access_token" string.tokenType - the "token_type" string. Defaults to "Bearer".expiresIn - the "expires_in" integer number for seconds until expire.refreshToken - the "refresh_token" string.scopes - the token "scope" as a collection of scope stringspublic final String getTokenType()
public final String getRefreshToken()
public final Collection<String> getScopes()
public final String getAccessToken()
public final long getExpiresIn()
public boolean hasScope(String scope)
scope - protected static Map<String,String> getPropertyMap()
Copyright © 2017. All rights reserved.