# CreateCustomCredentialRequest

# CreateCustomCredentialRequest

Artifact:[androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials)  
[View Source](https://cs.android.com/search?q=file:androidx/credentials/CreateCustomCredentialRequest.kt+class:androidx.credentials.CreateCustomCredentialRequest)  
Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/credentials/CreateCustomCredentialRequest "View this page in Java")

<br />

```
open class CreateCustomCredentialRequest : CreateCredentialRequest
```

<br />

|---|---|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                            |||
| ↳ | [androidx.credentials.CreateCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest)                ||
|   | ↳ | [androidx.credentials.CreateCustomCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest) |

*** ** * ** ***

Base custom create request class for registering a credential.

An application can construct a subtype custom request and call[CredentialManager.createCredential](https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManager#createCredential(android.content.Context,androidx.credentials.CreateCredentialRequest))to launch framework UI flows to collect consent and any other metadata needed from the user to register a new user credential.

If you get a[CreateCustomCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest)instead of a type-safe request class such as[CreatePasswordRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreatePasswordRequest),[CreatePublicKeyCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreatePublicKeyCredentialRequest), etc., then you should check if you have any other library at interest that supports this custom[type](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#type())of credential request, and if so use its parsing utilities to resolve to a type-safe class within that library.

Note: The Bundle keys for[credentialData](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#credentialData())and[candidateQueryData](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#candidateQueryData())should not be in the form of androidx.credentials.\*\` as they are reserved for internal use by this androidx library.  

|                                                             Throws                                                             |
|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.IllegalArgumentException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html) | If[type](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#type())is empty                                                                                                                                                                                                                                                                                     |
| [kotlin.NullPointerException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html)         | If[type](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#type()),[credentialData](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#credentialData()), or[candidateQueryData](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#candidateQueryData())is null |

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CreateCustomCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest#CreateCustomCredentialRequest(kotlin.String,android.os.Bundle,android.os.Bundle,kotlin.Boolean,androidx.credentials.CreateCredentialRequest.DisplayInfo,kotlin.Boolean,kotlin.String,kotlin.Boolean))`(` ` type: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`,` ` credentialData: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`,` ` candidateQueryData: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`,` ` isSystemProviderRequired: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` displayInfo: `[CreateCredentialRequest.DisplayInfo](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo)`,` ` isAutoSelectAllowed: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` origin: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?,` ` preferImmediatelyAvailableCredentials: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.credentials.CreateCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest) |------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                                                       | [candidateQueryData](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#candidateQueryData()) the partial request data in the[Bundle](https://developer.android.com/reference/android/os/Bundle.html)format that will be sent to the provider during the initial candidate query stage, which should not contain sensitive user credential information (note: bundle keys in the form of`androidx.credentials.*`are reserved for internal library use)                                                                                                                                                                                                                                                                                                                   | | [Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                                                       | [credentialData](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#credentialData()) the request data in the[Bundle](https://developer.android.com/reference/android/os/Bundle.html)format                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [CreateCredentialRequest.DisplayInfo](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo) | [displayInfo](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#displayInfo()) the information to be displayed on the screen                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                            | [isAutoSelectAllowed](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#isAutoSelectAllowed()) whether a create option will be automatically chosen if it is the only one available to the user                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                            | [isSystemProviderRequired](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#isSystemProviderRequired()) true if must only be fulfilled by a system provider and false otherwise                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?`                                                           | [origin](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#origin()) the origin of a different application if the request is being made on behalf of that application (Note: for API level \>=34, setting a non-null value for this parameter will throw a SecurityException if android.permission.CREDENTIAL_MANAGER_SET_ORIGIN is not present)                                                                                                                                                                                                                                                                                                                                                                                                                        | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                            | [preferImmediatelyAvailableCredentials](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#preferImmediatelyAvailableCredentials()) true if you prefer the operation to return immediately when there is no available passkey registration offering instead of falling back to discovering remote options, and false (preferred by default) otherwise                                                                                                                                                                                                                                                                                                                                                                                                                    | | [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                              | [type](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#type()) the credential type determined by the credential-type-specific subclass (e.g. the type for[CreatePasswordRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreatePasswordRequest)is[PasswordCredential.TYPE_PASSWORD_CREDENTIAL](https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL())and for[CreatePublicKeyCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreatePublicKeyCredentialRequest)is[PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL](https://developer.android.com/reference/kotlin/androidx/credentials/PublicKeyCredential#TYPE_PUBLIC_KEY_CREDENTIAL())) | |

## Public constructors

### CreateCustomCredentialRequest

Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)  

```
CreateCustomCredentialRequest(
    type: String,
    credentialData: Bundle,
    candidateQueryData: Bundle,
    isSystemProviderRequired: Boolean,
    displayInfo: CreateCredentialRequest.DisplayInfo,
    isAutoSelectAllowed: Boolean = false,
    origin: String? = null,
    preferImmediatelyAvailableCredentials: Boolean = false
)
```  

|                                                                          Parameters                                                                           |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                     | the credential type determined by the credential-type-specific subclass for custom use cases                                                                                                                                                                                                                                                                                         |
| `credentialData: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                                                    | the data of this[CreateCustomCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCustomCredentialRequest)in the[Bundle](https://developer.android.com/reference/android/os/Bundle.html)format (note: bundle keys in the form of`androidx.credentials.*`and`android.credentials.*`are reserved for internal library usage)                   |
| `candidateQueryData: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                                                | the partial request data in the[Bundle](https://developer.android.com/reference/android/os/Bundle.html)format that will be sent to the provider during the initial candidate query stage, which should not contain sensitive user credential information (note: bundle keys in the form of`androidx.credentials.*`and`android.credentials.*`are reserved for internal library usage) |
| `isSystemProviderRequired: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                               | true if must only be fulfilled by a system provider and false otherwise                                                                                                                                                                                                                                                                                                              |
| `displayInfo: `[CreateCredentialRequest.DisplayInfo](https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo) | the information to be displayed on the screen                                                                                                                                                                                                                                                                                                                                        |
| `isAutoSelectAllowed: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` = false`                                          | defines if a create entry will be automatically chosen if it is the only one available option, false by default                                                                                                                                                                                                                                                                      |
| `origin: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`? = null`                                                         | the origin of a different application if the request is being made on behalf of that application (Note: for API level \>=34, setting a non-null value for this parameter will throw a SecurityException if android.permission.CREDENTIAL_MANAGER_SET_ORIGIN is not present)                                                                                                          |
| `preferImmediatelyAvailableCredentials: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` = false`                        | true if you prefer the operation to return immediately when there is no available passkey registration offering instead of falling back to discovering remote options, and false (default) otherwise                                                                                                                                                                                 |