public final class CredentialStoreRefreshListener implements CredentialRefreshListener
(deprecated) (to be removed in the future) Use DataStoreCredentialRefreshListener instead.
BetaThread-safe OAuth 2.0 credential refresh listener that stores the refresh token response in the credential store.
It needs to be added as a refresh listener using Credential.Builder#addRefreshListener.
Implements
CredentialRefreshListenerConstructors
CredentialStoreRefreshListener(String userId, CredentialStore credentialStore) (deprecated)
public CredentialStoreRefreshListener(String userId, CredentialStore credentialStore)
Name | Description |
userId | String user ID whose credential is to be updated |
credentialStore | CredentialStore credential store |
Methods
getCredentialStore() (deprecated)
public CredentialStore getCredentialStore()
Returns the credential store.
Type | Description |
CredentialStore |
makePersistent(Credential credential) (deprecated)
public void makePersistent(Credential credential)
Stores the updated credential in the credential store.
Name | Description |
credential | Credential |
Type | Description |
IOException |
onTokenErrorResponse(Credential credential, TokenErrorResponse tokenErrorResponse) (deprecated)
public void onTokenErrorResponse(Credential credential, TokenErrorResponse tokenErrorResponse)
Notifies of an error token response from Credential#refreshToken().
Typical use is to provide functionality like removing persistence of the access token from
the data store. Implementations can assume proper thread synchronization is already taken care
of inside Credential#refreshToken(). Implementations can also assume that Credential#setAccessToken, and Credential#setExpiresInSeconds have already been called
previously with null
to clear their values.
Name | Description |
credential | Credential |
tokenErrorResponse | TokenErrorResponse |
Type | Description |
IOException |
onTokenResponse(Credential credential, TokenResponse tokenResponse) (deprecated)
public void onTokenResponse(Credential credential, TokenResponse tokenResponse)
Notifies of a successful token response from Credential#refreshToken().
Typical use is to provide functionality like persisting the access token in a data store. Implementations can assume proper thread synchronization is already taken care of inside Credential#refreshToken(). Implementations can also assume that Credential#setAccessToken, Credential#setRefreshToken, and Credential#setExpiresInSeconds have already been called previously with the information from the TokenResponse.
Name | Description |
credential | Credential |
tokenResponse | TokenResponse |
Type | Description |
IOException |