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 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 RegisterCredentialsResponse

Registers credentials with the Credential Manager.

abstract Unit

Registers credentials with the Credential Manager.

Constants

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 and the verifier request 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-alpha01
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

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-alpha01
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