# BeginCreatePasswordCredentialRequest

# BeginCreatePasswordCredentialRequest

Artifact:[androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials)  
[View Source](https://cs.android.com/search?q=file:androidx/credentials/provider/BeginCreatePasswordCredentialRequest.kt+class:androidx.credentials.provider.BeginCreatePasswordCredentialRequest)  
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/provider/BeginCreatePasswordCredentialRequest "View this page in Java")

<br />

```
class BeginCreatePasswordCredentialRequest : BeginCreateCredentialRequest
```

<br />

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

*** ** * ** ***

Request to begin saving a password credential, received by the provider with a CredentialProviderBaseService.onBeginCreateCredentialRequest call.

This request will not contain all parameters needed to store the password. Provider must use the initial parameters to determine if the password can be stored, and return a[BeginGetCredentialResponse](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginGetCredentialResponse)containing a list of[CreateEntry](https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry), denoting the accounts/groups where the password can be stored. When user selects one of the returned[CreateEntry](https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry), the corresponding[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)set on the[CreateEntry](https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry)will be fired. The[Intent](https://developer.android.com/reference/android/content/Intent.html)invoked through the[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)will contain the complete[CreatePasswordRequest](https://developer.android.com/reference/kotlin/androidx/credentials/CreatePasswordRequest)as part of its extras, to be retrieved by passing the intent to[PendingIntentHandler.retrieveProviderCreateCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/provider/PendingIntentHandler#retrieveProviderCreateCredentialRequest(android.content.Intent)). This request will contain all required parameters needed to actually store the password.  

|                                                         Throws                                                         |
|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.NullPointerException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html) | If[candidateQueryData](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreatePasswordCredentialRequest#candidateQueryData())is null |

|                                                                 See also                                                                  |
|-------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BeginCreateCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreateCredentialRequest) | Note : Credential providers are not expected to utilize the constructor in this class for any production flow. This constructor must only be used for testing purposes. |

## Summary

|                                                                                                                                                                                                                                                                                                                                    ### Public constructors                                                                                                                                                                                                                                                                                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BeginCreatePasswordCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreatePasswordCredentialRequest#BeginCreatePasswordCredentialRequest(androidx.credentials.provider.CallingAppInfo,android.os.Bundle))`(` ` callingAppInfo: `[CallingAppInfo](https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo)`?,` ` candidateQueryData: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html) `)` constructs an instance of[BeginCreatePasswordCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreatePasswordCredentialRequest) |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.credentials.provider.BeginCreateCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreateCredentialRequest) |------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------| | [CallingAppInfo](https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo)`?` | [callingAppInfo](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreateCredentialRequest#callingAppInfo())         | | [Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                         | [candidateQueryData](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreateCredentialRequest#candidateQueryData()) | | [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                | [type](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreateCredentialRequest#type())                             | |

## Public constructors

### BeginCreatePasswordCredentialRequest

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

```
BeginCreatePasswordCredentialRequest(
    callingAppInfo: CallingAppInfo?,
    candidateQueryData: Bundle
)
```

constructs an instance of[BeginCreatePasswordCredentialRequest](https://developer.android.com/reference/kotlin/androidx/credentials/provider/BeginCreatePasswordCredentialRequest)  

|                                                             Parameters                                                             |
|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `callingAppInfo: `[CallingAppInfo](https://developer.android.com/reference/kotlin/androidx/credentials/provider/CallingAppInfo)`?` | the information associated with the requesting for the credentials                                                                                                                                                                                               |
| `candidateQueryData: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                     | the bundle containing raw key-value pairs coming from the app requesting the credentials, mostly to be ignored for a password request, and only to be used if the credential provider knows of some custom attributes being provided by a particular calling app |