Class TokenResult
- java.lang.Object
-
- org.glassfish.jersey.client.oauth2.TokenResult
-
public class TokenResult extends Object
Class that contains a result of the Authorization Flow including a access token.All result properties can be get by the method
getAllProperties(). Some of the properties are standardized by the OAuth 2 specification and therefore the class contains getters that extract these properties from the property map.- Since:
- 2.3
- Author:
- Miroslav Fuksa
-
-
Constructor Summary
Constructors Constructor Description TokenResult(Map<String,Object> properties)Create a new instance initiated from the property map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessToken()Get access token.Map<String,Object>getAllProperties()Get the map of all properties returned in the Access Token Response.LonggetExpiresIn()Get expiration time of theaccess tokenin seconds.StringgetRefreshToken()Get the refresh token.StringgetTokenType()Get the type of the returned access token.
-
-
-
Method Detail
-
getAccessToken
public String getAccessToken()
Get access token.- Returns:
- Access token.
-
getExpiresIn
public Long getExpiresIn()
Get expiration time of theaccess tokenin seconds.- Returns:
- Expiration time in seconds or
nullif the value is not provided.
-
getRefreshToken
public String getRefreshToken()
Get the refresh token. Note that the refresh token must not be issued during the authorization flow. Some Service Providers issue refresh token only on first user authorization and some providers does not support refresh token at all and authorization flow must be always performed when token expires.- Returns:
- Refresh token or
nullif the value is not provided.
-
getTokenType
public String getTokenType()
Get the type of the returned access token. Type is in most casesbearer(no cryptography is used) but provider might support also other kinds of token likemac.- Returns:
- Token type.
-
-