RestoreCredential


class RestoreCredential : Credential


Represents the user's restore credential for the app sign in. The restore credential is used to restore the user's credential from the previous device to a new Android device.

By creating a RestoreCredential for the user, the credential will be automatically transferred over to the user's new device if the user selects the app to be transferred from the old device during the setup stage.

The RestoreCredential can only be used for apps that the users have selected to be restored. The RestoreCredential for all other apps will not be transferred over from the old device. This Credential can be used to create a seamless authentication user experience by providing a 0-tap sign-in experience. If the RestoreCredential is available for an app, the user can be signed in programmatically without the user's input.

Throws
kotlin.IllegalArgumentException

If authenticationResponseJson is empty, or if it is not a valid JSON

See also
CreateRestoreCredentialRequest

on how to create a RestoreCredential instance.

Summary

Constants

const String

The type value for restore credential related operations.

Public properties

String

the request the public key credential authentication response in JSON format that follows the standard webauthn json format shown at (https://w3c.github.io/webauthn/#dictdef-authenticationresponsejson)

Inherited properties

From androidx.credentials.Credential
Bundle

the credential data in the Bundle format

String

the credential type determined by the credential-type-specific subclass (e.g. PasswordCredential.TYPE_PASSWORD_CREDENTIAL for PasswordCredential or PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL for PublicKeyCredential)

Constants

TYPE_RESTORE_CREDENTIAL

const val TYPE_RESTORE_CREDENTIALString

The type value for restore credential related operations.

Public properties

authenticationResponseJson

Added in 1.5.0-alpha03
val authenticationResponseJsonString

the request the public key credential authentication response in JSON format that follows the standard webauthn json format shown at (https://w3c.github.io/webauthn/#dictdef-authenticationresponsejson)