# SignalCredentialStateRequest

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

*** ** * ** ***


```
public abstract class SignalCredentialStateRequest
```

<br />

Known direct subclasses [SignalAllAcceptedCredentialIdsRequest](https://developer.android.com/reference/androidx/credentials/SignalAllAcceptedCredentialIdsRequest), [SignalCurrentUserDetailsRequest](https://developer.android.com/reference/androidx/credentials/SignalCurrentUserDetailsRequest), [SignalUnknownCredentialRequest](https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest)

|---|---|
| `https://developer.android.com/reference/androidx/credentials/SignalAllAcceptedCredentialIdsRequest` | A request to signal the complete list of public key credentials ids for a given user. |
| `https://developer.android.com/reference/androidx/credentials/SignalCurrentUserDetailsRequest` | A request to signal the user's current name and display name. |
| `https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest` | A request to signal that a credential ID was not recognized by the relying party. |

*** ** * ** ***

Base request class for sending credential state signals to providers.

An application can construct a subtype request and call `https://developer.android.com/reference/androidx/credentials/CredentialManager#signalCredentialState(androidx.credentials.SignalCredentialStateRequest)` to propagate a signal credential state request.

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest` | `https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest#createFrom(kotlin.String,kotlin.String,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html requestType, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html requestJson, https://developer.android.com/reference/java/lang/String.html origin )` Creates a SignalCredentialStateRequest from the given parameters. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest#getOrigin()()` 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) |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest#getRequestData()()` the bundle to contain the request json and any additional info |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest#getRequestJson()()` the signal request data in the expected json format |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest#getType()()` the request type representing one of `https://developer.android.com/reference/androidx/credentials/SignalAllAcceptedCredentialIdsRequest`, `https://developer.android.com/reference/androidx/credentials/SignalCurrentUserDetailsRequest` and `https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest`) |

## Public methods

### createFrom

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

```
public static final @NonNull SignalCredentialStateRequest createFrom(
    @NonNull String requestType,
    @NonNull String requestJson,
    String origin
)
```

Creates a SignalCredentialStateRequest from the given parameters.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html requestType` | the request type representing one of `https://developer.android.com/reference/androidx/credentials/SignalAllAcceptedCredentialIdsRequest`, `https://developer.android.com/reference/androidx/credentials/SignalCurrentUserDetailsRequest` and `https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest`) |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html requestJson` | the request json corresponding to the request data |
| `https://developer.android.com/reference/java/lang/String.html 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) |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if request json validation fails |
| `https://developer.android.com/reference/androidx/credentials/exceptions/publickeycredential/SignalCredentialSecurityException` | if origin is set without having android.permission.CREDENTIAl_MANAGER_SET_ORIGIN |

### getOrigin

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

```
public final String getOrigin()
```

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)

### getRequestData

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

```
public final @NonNull Bundle getRequestData()
```

the bundle to contain the request json and any additional info

### getRequestJson

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

```
public final @NonNull String getRequestJson()
```

the signal request data in the expected json format

### getType

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

```
public final @NonNull String getType()
```

the request type representing one of `https://developer.android.com/reference/androidx/credentials/SignalAllAcceptedCredentialIdsRequest`, `https://developer.android.com/reference/androidx/credentials/SignalCurrentUserDetailsRequest` and `https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest`)