Interface CredentialStore (1.32.1)

public interface CredentialStore

(deprecated) (to be removed in the future) Use DataStoreFactory with StoredCredential instead.

Beta
OAuth 2.0 credential persistence store interface to provide a fully pluggable storage mechanism.

The user ID should be used as the primary key for storage, and the rest of the data consists of the access token, refresh token, and expiration time.

Implementations should be thread safe.

Methods

delete(String userId, Credential credential) (deprecated)

public abstract void delete(String userId, Credential credential)

Deletes the credential of the given user ID.

Parameters
NameDescription
userIdString

user ID whose credential needs to be deleted

credentialCredential

credential to be deleted

Exceptions
TypeDescription
IOException

load(String userId, Credential credential) (deprecated)

public abstract boolean load(String userId, Credential credential)

Loads the credential for the given user ID.

Parameters
NameDescription
userIdString

user ID whose credential needs to be loaded

credentialCredential

credential whose access token, refresh token, and expiration time need to be set if the credential already exists in storage

Returns
TypeDescription
boolean

true if the credential has been successfully found and loaded or false otherwise

Exceptions
TypeDescription
IOException

store(String userId, Credential credential) (deprecated)

public abstract void store(String userId, Credential credential)

Stores the credential of the given user ID.

Parameters
NameDescription
userIdString

user ID whose credential needs to be stored

credentialCredential

credential whose access token, refresh token, and expiration time need to be stored

Exceptions
TypeDescription
IOException