abstract class RegistryManager


APIs for managing credential registries that are registered with the Credential Manager.

Use the APIs by constructing a RegistryManager with the create factory method.

Summary

Constants

const String

The intent action name that the Credential Manager used to find and invoke your activity when the user attempts to create a credential through your application.

const String

The intent action name that the Credential Manager used to find and invoke your activity when the user selects a credential that belongs to your application.

Public companion functions

RegistryManager
create(context: Context)

Creates a RegistryManager based on the given context.

Public functions

suspend ClearCreationOptionsResponse

Clear creation options that were registered using the registerCreationOptions (Kotlin) or registerCreationOptionsAsync (Java) API.

abstract Unit

Clear creation options that were registered using the registerCreationOptions (Kotlin) or registerCreationOptionsAsync (Java) API.

suspend ClearCredentialRegistryResponse

Clear registries that were registered using the registerCredentials (Kotlin) or registerCredentialsAsync (Java) API.

abstract Unit

Clear registries that were registered using the registerCredentials (Kotlin) or registerCredentialsAsync (Java) API.

suspend RegisterCreationOptionsResponse

Registers creation options with the Credential Manager.

abstract Unit

Registers creation options with the Credential Manager.

suspend RegisterCredentialsResponse

Registers credentials with the Credential Manager.

abstract Unit

Registers credentials with the Credential Manager.

Constants

ACTION_CREATE_CREDENTIAL

const val ACTION_CREATE_CREDENTIALString

The intent action name that the Credential Manager used to find and invoke your activity when the user attempts to create a credential through your application. Your activity will be launched and you should use the androidx.credentials.provider.PendingIntentHandler.retrieveProviderCreateCredentialRequest API to retrieve information contained in androidx.credentials.provider.ProviderCreateCredentialRequest.

Next, perform the necessary steps to generate a response for the given request. Pass the result back using one of the androidx.credentials.provider.PendingIntentHandler.setCreateCredentialResponse and androidx.credentials.provider.PendingIntentHandler.setCreateCredentialException APIs.

ACTION_GET_CREDENTIAL

const val ACTION_GET_CREDENTIALString

The intent action name that the Credential Manager used to find and invoke your activity when the user selects a credential that belongs to your application. Your activity will be launched and you should use the androidx.credentials.provider.PendingIntentHandler.retrieveProviderGetCredentialRequest API to retrieve information about the user selection (you can do this through androidx.credentials.registry.provider.selectedEntryId), the verifier request, and other caller app information contained in androidx.credentials.provider.ProviderGetCredentialRequest.

Next, perform the necessary steps (e.g. consent collection, credential lookup) to generate a response for the given request. Pass the result back using one of the androidx.credentials.provider.PendingIntentHandler.setGetCredentialResponse and androidx.credentials.provider.PendingIntentHandler.setGetCredentialException APIs.

Public companion functions

create

Added in 1.0.0-alpha04
fun create(context: Context): RegistryManager

Creates a RegistryManager based on the given context.

Parameters
context: Context

the context with which the RegistryManager should be associated

Public functions

clearCreationOptions

suspend fun clearCreationOptions(request: ClearCreationOptionsRequest): ClearCreationOptionsResponse

Clear creation options that were registered using the registerCreationOptions (Kotlin) or registerCreationOptionsAsync (Java) API.

Parameters
request: ClearCreationOptionsRequest

the request to specify clearing configurations

clearCreationOptionsAsync

Added in 1.0.0-alpha04
abstract fun clearCreationOptionsAsync(
    request: ClearCreationOptionsRequest,
    executor: Executor,
    callback: CredentialManagerCallback<ClearCreationOptionsResponseClearCreationOptionsException>
): Unit

Clear creation options that were registered using the registerCreationOptions (Kotlin) or registerCreationOptionsAsync (Java) API.

This API uses callbacks instead of Kotlin coroutines.

Parameters
request: ClearCreationOptionsRequest

the request to specify clearing configurations

executor: Executor

the callback will take place on this executor

callback: CredentialManagerCallback<ClearCreationOptionsResponseClearCreationOptionsException>

the callback invoked when the request succeeds or fails

clearCredentialRegistry

suspend fun clearCredentialRegistry(request: ClearCredentialRegistryRequest): ClearCredentialRegistryResponse

Clear registries that were registered using the registerCredentials (Kotlin) or registerCredentialsAsync (Java) API.

Parameters
request: ClearCredentialRegistryRequest

the request to specify clearing configurations

clearCredentialRegistryAsync

Added in 1.0.0-alpha04
abstract fun clearCredentialRegistryAsync(
    request: ClearCredentialRegistryRequest,
    executor: Executor,
    callback: CredentialManagerCallback<ClearCredentialRegistryResponseClearCredentialRegistryException>
): Unit

Clear registries that were registered using the registerCredentials (Kotlin) or registerCredentialsAsync (Java) API.

This API uses callbacks instead of Kotlin coroutines.

Parameters
request: ClearCredentialRegistryRequest

the request to specify clearing configurations

executor: Executor

the callback will take place on this executor

callback: CredentialManagerCallback<ClearCredentialRegistryResponseClearCredentialRegistryException>

the callback invoked when the request succeeds or fails

registerCreationOptions

suspend fun registerCreationOptions(request: RegisterCreationOptionsRequest): RegisterCreationOptionsResponse

Registers creation options with the Credential Manager.

The registries will then be used by the Credential Manager when handling an app calling request (see androidx.credentials.CredentialManager). The Credential Manager will determine if the registry contains some data qualified as a candidate to fulfill the given request, and if so it will surface a user selector UI to collect the user decision for whether to proceed with the operation.

Parameters
request: RegisterCreationOptionsRequest

the request containing the creation options to register

registerCreationOptionsAsync

Added in 1.0.0-alpha04
abstract fun registerCreationOptionsAsync(
    request: RegisterCreationOptionsRequest,
    cancellationSignal: CancellationSignal?,
    executor: Executor,
    callback: CredentialManagerCallback<RegisterCreationOptionsResponseRegisterCreationOptionsException>
): Unit

Registers creation options with the Credential Manager.

This API uses callbacks instead of Kotlin coroutines.

The registries will then be used by the Credential Manager when handling an app calling request (see androidx.credentials.CredentialManager.createCredential and androidx.credentials.CredentialManager.createCredentialAsync). The Credential Manager will determine if the registry contains some data qualified as a candidate to fulfill the given request, and if so it will surface a user selector UI to collect the user decision for whether to proceed with the operation.

Parameters
request: RegisterCreationOptionsRequest

the request containing the creation options to register

cancellationSignal: CancellationSignal?

an optional signal that allows for cancelling this call

executor: Executor

the callback will take place on this executor

callback: CredentialManagerCallback<RegisterCreationOptionsResponseRegisterCreationOptionsException>

the callback invoked when the request succeeds or fails

registerCredentials

suspend fun registerCredentials(request: RegisterCredentialsRequest): RegisterCredentialsResponse

Registers credentials with the Credential Manager.

The registries will then be used by the Credential Manager when handling an app calling request (see androidx.credentials.CredentialManager). The Credential Manager will determine if the registry contains some credential(s) qualified as a candidate to fulfill the given request, and if so it will surface a user selector UI to collect the user decision for whether to proceed with the operation.

Parameters
request: RegisterCredentialsRequest

the request containing the credential data to register

registerCredentialsAsync

Added in 1.0.0-alpha04
abstract fun registerCredentialsAsync(
    request: RegisterCredentialsRequest,
    cancellationSignal: CancellationSignal?,
    executor: Executor,
    callback: CredentialManagerCallback<RegisterCredentialsResponseRegisterCredentialsException>
): Unit

Registers credentials with the Credential Manager.

This API uses callbacks instead of Kotlin coroutines.

The registries will then be used by the Credential Manager when handling an app calling request (see androidx.credentials.CredentialManager). The Credential Manager will determine if the registry contains some credential(s) qualified as a candidate to fulfill the given request, and if so it will surface a user selector UI to collect the user decision for whether to proceed with the operation.

Parameters
request: RegisterCredentialsRequest

the request containing the credential data to register

cancellationSignal: CancellationSignal?

an optional signal that allows for cancelling this call

executor: Executor

the callback will take place on this executor

callback: CredentialManagerCallback<RegisterCredentialsResponseRegisterCredentialsException>

the callback invoked when the request succeeds or fails