CredentialService

Stores the credentials tools obtain, such as a user's OAuth2 tokens, so that later invocations can reuse them instead of asking the user to sign in again. A failure of the underlying store propagates as an exception.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun loadCredential(authConfig: AuthConfig, context: Context): AuthCredential?

Returns the credential stored under authConfig's AuthConfig.credentialKey for context, or null if there is none.

Link copied to clipboard
abstract suspend fun saveCredential(authConfig: AuthConfig, context: Context)

Stores authConfig's AuthConfig.exchangedAuthCredential under its AuthConfig.credentialKey for context. If that credential is null, a later loadCredential returns null.