# PasswordCredential

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

*** ** * ** ***

<br />

```
class PasswordCredential : Credential
```

<br />

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

*** ** * ** ***

Represents the user's password credential granted by the user for app sign-in.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()` The type value for password related operations. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#PasswordCredential(kotlin.String,kotlin.String)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, password: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Constructs a `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential`. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#id()` the user id associated with the password |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#password()` the password |

### Inherited properties

From [androidx.credentials.Credential](https://developer.android.com/reference/kotlin/androidx/credentials/Credential) `https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/kotlin/androidx/credentials/Credential#data()`

the credential data in the `https://developer.android.com/reference/android/os/Bundle.html` format
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/credentials/Credential#type()`

the credential type determined by the credential-type-specific subclass (e.g. `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()` for `PasswordCredential` or `https://developer.android.com/reference/kotlin/androidx/credentials/PublicKeyCredential#TYPE_PUBLIC_KEY_CREDENTIAL()` for `PublicKeyCredential`)

## Constants

### TYPE_PASSWORD_CREDENTIAL

```
const val TYPE_PASSWORD_CREDENTIAL: String
```

The type value for password related operations.

## Public constructors

### PasswordCredential

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

```
PasswordCredential(id: String, password: String)
```

Constructs a `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential`.

| Parameters |
|---|---|
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the user id associated with the password |
| `password: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the password |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#(kotlin.String,kotlin.String)` is null |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-null-pointer-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#(kotlin.String,kotlin.String)` is null |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#(kotlin.String,kotlin.String)` is empty |

## Public properties

### id

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

```
val id: String
```

the user id associated with the password

### password

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

```
val password: String
```

the password