Interface CredentialStore (1.34.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
Name Description
userId String

user ID whose credential needs to be deleted

credential Credential

credential to be deleted

Exceptions
Type Description
IOException

load(String userId, Credential credential) (deprecated)

public abstract boolean load(String userId, Credential credential)

Loads the credential for the given user ID.

Parameters
Name Description
userId String

user ID whose credential needs to be loaded

credential Credential

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

Returns
Type Description
boolean

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

Exceptions
Type Description
IOException

store(String userId, Credential credential) (deprecated)

public abstract void store(String userId, Credential credential)

Stores the credential of the given user ID.

Parameters
Name Description
userId String

user ID whose credential needs to be stored

credential Credential

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

Exceptions
Type Description
IOException