RestoreCredential


public final class RestoreCredential extends 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

static final @NonNull String

The type value for restore credential related operations.

Public methods

final @NonNull 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 methods

From androidx.credentials.Credential
final @NonNull Bundle

the credential data in the Bundle format

final @NonNull 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

public static final @NonNull String TYPE_RESTORE_CREDENTIAL

The type value for restore credential related operations.

Public methods

getAuthenticationResponseJson

Added in 1.5.0-alpha03
public final @NonNull String getAuthenticationResponseJson()

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)