Class OAuth2CredentialsWithRefresh (1.19.0)

public class OAuth2CredentialsWithRefresh extends OAuth2Credentials

A refreshable alternative to OAuth2Credentials.

To enable automatic token refreshes, you must provide an OAuth2RefreshHandler.

Inheritance

java.lang.Object > Credentials > OAuth2Credentials > OAuth2CredentialsWithRefresh

Static Methods

newBuilder()

public static OAuth2CredentialsWithRefresh.Builder newBuilder()
Returns
TypeDescription
OAuth2CredentialsWithRefresh.Builder

Constructors

OAuth2CredentialsWithRefresh(AccessToken accessToken, OAuth2CredentialsWithRefresh.OAuth2RefreshHandler refreshHandler)

protected OAuth2CredentialsWithRefresh(AccessToken accessToken, OAuth2CredentialsWithRefresh.OAuth2RefreshHandler refreshHandler)
Parameters
NameDescription
accessTokenAccessToken
refreshHandlerOAuth2CredentialsWithRefresh.OAuth2RefreshHandler

OAuth2CredentialsWithRefresh(OAuth2CredentialsWithRefresh.Builder builder)

protected OAuth2CredentialsWithRefresh(OAuth2CredentialsWithRefresh.Builder builder)
Parameter
NameDescription
builderOAuth2CredentialsWithRefresh.Builder

Methods

getRefreshHandler()

public OAuth2CredentialsWithRefresh.OAuth2RefreshHandler getRefreshHandler()

Returns the provided OAuth2RefreshHandler.

Returns
TypeDescription
OAuth2CredentialsWithRefresh.OAuth2RefreshHandler

refreshAccessToken()

public AccessToken refreshAccessToken()

Refreshes the access token using the provided OAuth2RefreshHandler.

Returns
TypeDescription
AccessToken
Overrides
Exceptions
TypeDescription
IOException