# RegistryManager

Artifact: [androidx.credentials.registry:registry-provider](https://developer.android.com/jetpack/androidx/releases/credentials-registry) [View Source](https://cs.android.com/search?q=file:androidx/credentials/registry/provider/RegistryManager.kt+class:androidx.credentials.registry.provider.RegistryManager) Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

*** ** * ** ***


```
abstract class RegistryManager
```

<br />

*** ** * ** ***

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

Use the APIs by constructing a `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager` with the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#create(android.content.Context)` factory method.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#ACTION_CREATE_CREDENTIAL()` 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 https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#ACTION_GET_CREDENTIAL()` 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 |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#create(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager` based on the given `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager.Companion#create(android.content.Context)`. |

| ### Public functions |
|---|---|
| `suspend https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsResponse` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#clearCreationOptions(androidx.credentials.registry.provider.ClearCreationOptionsRequest)(request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsRequest)` Clear creation options that were registered using the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptions(androidx.credentials.registry.provider.RegisterCreationOptionsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptionsAsync(androidx.credentials.registry.provider.RegisterCreationOptionsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#clearCreationOptionsAsync(androidx.credentials.registry.provider.ClearCreationOptionsRequest,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)( request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsRequest, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsException> )` Clear creation options that were registered using the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptions(androidx.credentials.registry.provider.RegisterCreationOptionsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptionsAsync(androidx.credentials.registry.provider.RegisterCreationOptionsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API. |
| `suspend https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryResponse` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#clearCredentialRegistry(androidx.credentials.registry.provider.ClearCredentialRegistryRequest)(request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryRequest)` Clear registries that were registered using the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentials(androidx.credentials.registry.provider.RegisterCredentialsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentialsAsync(androidx.credentials.registry.provider.RegisterCredentialsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#clearCredentialRegistryAsync(androidx.credentials.registry.provider.ClearCredentialRegistryRequest,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)( request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryRequest, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryException> )` Clear registries that were registered using the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentials(androidx.credentials.registry.provider.RegisterCredentialsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentialsAsync(androidx.credentials.registry.provider.RegisterCredentialsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API. |
| `suspend https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsResponse` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptions(androidx.credentials.registry.provider.RegisterCreationOptionsRequest)(request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsRequest)` Registers creation options with the Credential Manager. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptionsAsync(androidx.credentials.registry.provider.RegisterCreationOptionsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)( request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsRequest, cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsException> )` Registers creation options with the Credential Manager. |
| `suspend https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsResponse` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentials(androidx.credentials.registry.provider.RegisterCredentialsRequest)(request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsRequest)` Registers credentials with the Credential Manager. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentialsAsync(androidx.credentials.registry.provider.RegisterCredentialsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)( request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsRequest, cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html, callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsException> )` Registers credentials with the Credential Manager. |

## Constants

### ACTION_CREATE_CREDENTIAL

```
const val ACTION_CREATE_CREDENTIAL: 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. Your activity will be launched and you should use the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PendingIntentHandler#retrieveProviderCreateCredentialRequest(android.content.Intent)` API to retrieve information contained in `https://developer.android.com/reference/kotlin/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 `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PendingIntentHandler#setCreateCredentialResponse(android.content.Intent,androidx.credentials.CreateCredentialResponse)` and `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PendingIntentHandler#setCreateCredentialException(android.content.Intent,androidx.credentials.exceptions.CreateCredentialException)` APIs.

### ACTION_GET_CREDENTIAL

```
const val ACTION_GET_CREDENTIAL: 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. Your activity will be launched and you should use the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PendingIntentHandler#retrieveProviderGetCredentialRequest(android.content.Intent)` API to retrieve information about the user selection (you can do this through `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/package-summary#(androidx.credentials.provider.ProviderCreateCredentialRequest).selectedEntryId()`), the verifier request, and other caller app information contained in `https://developer.android.com/reference/kotlin/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 `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PendingIntentHandler#setGetCredentialResponse(android.content.Intent,androidx.credentials.GetCredentialResponse,androidx.credentials.provider.ProviderGetCredentialRequest)` and `https://developer.android.com/reference/kotlin/androidx/credentials/provider/PendingIntentHandler#setGetCredentialException(android.content.Intent,androidx.credentials.exceptions.GetCredentialException)` APIs.

## Public companion functions

### create

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
fun create(context: Context): RegistryManager
```

Creates a `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager` based on the given `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager.Companion#create(android.content.Context)`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | 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 `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptions(androidx.credentials.registry.provider.RegisterCreationOptionsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptionsAsync(androidx.credentials.registry.provider.RegisterCreationOptionsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API.

| Parameters |
|---|---|
| `request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsRequest` | the request to specify clearing configurations |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsException` | If the request fails |

### clearCreationOptionsAsync

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
abstract fun clearCreationOptionsAsync(
    request: ClearCreationOptionsRequest,
    executor: Executor,
    callback: CredentialManagerCallback<ClearCreationOptionsResponse, ClearCreationOptionsException>
): Unit
```

Clear creation options that were registered using the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptions(androidx.credentials.registry.provider.RegisterCreationOptionsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCreationOptionsAsync(androidx.credentials.registry.provider.RegisterCreationOptionsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API.

This API uses callbacks instead of Kotlin coroutines.

| Parameters |
|---|---|
| `request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsRequest` | the request to specify clearing configurations |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | the callback will take place on this executor |
| `callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCreationOptionsException>` | the callback invoked when the request succeeds or fails |

### clearCredentialRegistry

```
suspend fun clearCredentialRegistry(request: ClearCredentialRegistryRequest): ClearCredentialRegistryResponse
```

Clear registries that were registered using the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentials(androidx.credentials.registry.provider.RegisterCredentialsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentialsAsync(androidx.credentials.registry.provider.RegisterCredentialsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API.

| Parameters |
|---|---|
| `request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryRequest` | the request to specify clearing configurations |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryException` | If the request fails |

### clearCredentialRegistryAsync

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
abstract fun clearCredentialRegistryAsync(
    request: ClearCredentialRegistryRequest,
    executor: Executor,
    callback: CredentialManagerCallback<ClearCredentialRegistryResponse, ClearCredentialRegistryException>
): Unit
```

Clear registries that were registered using the `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentials(androidx.credentials.registry.provider.RegisterCredentialsRequest)` (Kotlin) or `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegistryManager#registerCredentialsAsync(androidx.credentials.registry.provider.RegisterCredentialsRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)` (Java) API.

This API uses callbacks instead of Kotlin coroutines.

| Parameters |
|---|---|
| `request: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryRequest` | the request to specify clearing configurations |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | the callback will take place on this executor |
| `callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/ClearCredentialRegistryException>` | 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 `https://developer.android.com/reference/kotlin/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: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsRequest` | the request containing the creation options to register |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsException` | If the request fails |

### registerCreationOptionsAsync

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
abstract fun registerCreationOptionsAsync(
    request: RegisterCreationOptionsRequest,
    cancellationSignal: CancellationSignal?,
    executor: Executor,
    callback: CredentialManagerCallback<RegisterCreationOptionsResponse, RegisterCreationOptionsException>
): 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 `https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManager#createCredential(android.content.Context,androidx.credentials.CreateCredentialRequest)` and `https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManager#createCredentialAsync(android.content.Context,androidx.credentials.CreateCredentialRequest,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.credentials.CredentialManagerCallback)`). 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: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsRequest` | the request containing the creation options to register |
| `cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?` | an optional signal that allows for cancelling this call |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | the callback will take place on this executor |
| `callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCreationOptionsException>` | 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 `https://developer.android.com/reference/kotlin/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: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsRequest` | the request containing the credential data to register |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsException` | If the request fails |

### registerCredentialsAsync

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
abstract fun registerCredentialsAsync(
    request: RegisterCredentialsRequest,
    cancellationSignal: CancellationSignal?,
    executor: Executor,
    callback: CredentialManagerCallback<RegisterCredentialsResponse, RegisterCredentialsException>
): 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 `https://developer.android.com/reference/kotlin/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: https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsRequest` | the request containing the credential data to register |
| `cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?` | an optional signal that allows for cancelling this call |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | the callback will take place on this executor |
| `callback: https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback<https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsResponse, https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsException>` | the callback invoked when the request succeeds or fails |