# SignalUnknownCredentialRequest

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

*** ** * ** ***


```
public final class SignalUnknownCredentialRequest extends SignalCredentialStateRequest
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.credentials.SignalCredentialStateRequest](https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest) ||
|   | ↳ | [androidx.credentials.SignalUnknownCredentialRequest](https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest) |

*** ** * ** ***

A request to signal that a credential ID was not recognized by the relying party.

| 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 |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest#SignalUnknownCredentialRequest(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html requestJson)` Constructs a request to signal that a credential ID is not recognized by the calling app. |
| `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_SET_ORIGIN", conditional = true) https://developer.android.com/reference/androidx/credentials/SignalUnknownCredentialRequest#SignalUnknownCredentialRequest(kotlin.String,kotlin.String)( @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 )` Constructs a request to signal that a credential ID is not recognized by the calling app. |

| ### Inherited methods |
|---|
| From [androidx.credentials.SignalCredentialStateRequest](https://developer.android.com/reference/androidx/credentials/SignalCredentialStateRequest) |---|---| | `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 constructors

### SignalUnknownCredentialRequest

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

```
public SignalUnknownCredentialRequest(@NonNull String requestJson)
```

Constructs a request to signal that a credential ID is not recognized by the calling app.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html requestJson` | the request in JSON format. The format of the JSON should follow the [WebAuthn Spec](https://w3c.github.io/webauthn/#sctn-signalUnknownCredential). Throws SignalCredentialStateException if base64Url decoding fails for the credential id |

### SignalUnknownCredentialRequest

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

```
@RequiresPermission(value = "android.permission.CREDENTIAL_MANAGER_SET_ORIGIN", conditional = true)
public SignalUnknownCredentialRequest(
    @NonNull String requestJson,
    String origin
)
```

Constructs a request to signal that a credential ID is not recognized by the calling app.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html requestJson` | the request in JSON format. The format of the JSON should follow the [WebAuthn Spec](https://w3c.github.io/webauthn/#sctn-signalUnknownCredential). Throws SignalCredentialStateException if base64Url decoding fails for the credential id |
| `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, to be used only by browsers or privileged apps recognized by the target credential provider (Note: if a non-browser/non-privileged app sets an origin, it will be rejected across all API levels, and for API level \>=34, the calling party must also have the android.permission.CREDENTIAL_MANAGER_SET_ORIGIN permission otherwise a SecurityException will be thrown) |

| 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 |