GetRestoreCredentialOption


class GetRestoreCredentialOption : CredentialOption


A request to get the restore credential from the restore credential provider.

Throws
kotlin.IllegalArgumentException

if the requestJson is an invalid Json that does not follow the standard webauthn web json format

androidx.credentials.exceptions.NoCredentialException

if no viable restore credential is found

kotlin.IllegalArgumentException

if the option is mixed with another CredentialOption

Summary

Public constructors

Public properties

String

the request in JSON format in the standard webauthn web json (https://w3c.github.io/webauthn/#dictdef-publickeycredentialrequestoptionsjson).

Inherited properties

From androidx.credentials.CredentialOption
Set<ComponentName>

a set of provider service ComponentName allowed to receive this option (Note: a SecurityException will be thrown if it is set as non-empty but your app does not have android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS; empty means every provider is eligible; for API level < 34, this property will not take effect and you should control the allowed provider via library dependencies)

Bundle

the partial request data in the Bundle format that will be sent to the provider during the initial candidate query stage, which will not contain sensitive user information

Boolean

whether a credential entry will be automatically chosen if it is the only one available option

Boolean

true if must only be fulfilled by a system provider and false otherwise

Bundle

the request data in the Bundle format

String

the credential type determined by the credential-type-specific subclass (e.g. the type for GetPasswordOption is PasswordCredential.TYPE_PASSWORD_CREDENTIAL and for GetPublicKeyCredentialOption is PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL)

Int

sets the priority of this entry, which defines how it appears in the credential selector, with less precedence than account ordering but more precedence than last used time; see PriorityHints for more information

Public constructors

GetRestoreCredentialOption

Added in 1.5.0-beta01
GetRestoreCredentialOption(requestJson: String)

Public properties

requestJson

Added in 1.5.0-beta01
val requestJsonString

the request in JSON format in the standard webauthn web json (https://w3c.github.io/webauthn/#dictdef-publickeycredentialrequestoptionsjson).

Note that the userVerification field of the requestJson will always be overridden to discouraged to support passive authentication during restore flow.

GetRestoreCredentialOption cannot be requested with other credential options because of conflicting user experience. When requesting restore credential, only a single GetRestoreCredentialOption must be supplied.