public class OAuth2CredentialsWithRefresh extends OAuth2Credentials
A refreshable alternative to OAuth2Credentials.
To enable automatic token refreshes, you must provide an OAuth2RefreshHandler.
Static Methods
newBuilder()
public static OAuth2CredentialsWithRefresh.Builder newBuilder()
Returns | |
---|---|
Type | Description |
OAuth2CredentialsWithRefresh.Builder |
Constructors
OAuth2CredentialsWithRefresh(AccessToken accessToken, OAuth2CredentialsWithRefresh.OAuth2RefreshHandler refreshHandler)
protected OAuth2CredentialsWithRefresh(AccessToken accessToken, OAuth2CredentialsWithRefresh.OAuth2RefreshHandler refreshHandler)
Parameters | |
---|---|
Name | Description |
accessToken | AccessToken |
refreshHandler | OAuth2CredentialsWithRefresh.OAuth2RefreshHandler |
Methods
getRefreshHandler()
public OAuth2CredentialsWithRefresh.OAuth2RefreshHandler getRefreshHandler()
Returns the provided OAuth2RefreshHandler.
Returns | |
---|---|
Type | Description |
OAuth2CredentialsWithRefresh.OAuth2RefreshHandler |
refreshAccessToken()
public AccessToken refreshAccessToken()
Refreshes the access token using the provided OAuth2RefreshHandler.
Returns | |
---|---|
Type | Description |
AccessToken |
Exceptions | |
---|---|
Type | Description |
IOException |