Class OAuth2CredentialsWithRefresh (1.25.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
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

OAuth2CredentialsWithRefresh(OAuth2CredentialsWithRefresh.Builder builder)

protected OAuth2CredentialsWithRefresh(OAuth2CredentialsWithRefresh.Builder builder)
Parameter
Name Description
builder OAuth2CredentialsWithRefresh.Builder

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
Overrides
Exceptions
Type Description
IOException