Stay organized with collections Save and categorize content based on your preferences.

CreatePublicKeyCredentialRequest

public final class CreatePublicKeyCredentialRequest extends CreateCredentialRequest


A request to register a passkey from the user's public key credential provider.

Summary

Public constructors

CreatePublicKeyCredentialRequest(
    @NonNull String requestJson,
    String clientDataHash,
    boolean preferImmediatelyAvailableCredentials,
    String origin
)

Constructs a CreatePublicKeyCredentialRequest to register a passkey from the user's public key credential provider.

Public methods

final String

a hash that is used to verify the origin

final @NonNull String

the request in JSON format in the standard webauthn web json.

final boolean

true if you prefer the operation to return immediately when there is no available passkey registration offering instead of falling back to discovering remote options, and false (default) otherwise

Public constructors

CreatePublicKeyCredentialRequest

public CreatePublicKeyCredentialRequest(
    @NonNull String requestJson,
    String clientDataHash,
    boolean preferImmediatelyAvailableCredentials,
    String origin
)

Constructs a CreatePublicKeyCredentialRequest to register a passkey from the user's public key credential provider.

Parameters
@NonNull String requestJson

the privileged request in JSON format in the standard webauthn web json.

String clientDataHash

a hash that is used to verify the relying party identity

boolean preferImmediatelyAvailableCredentials

true if you prefer the operation to return immediately when there is no available passkey registration offering instead of falling back to discovering remote options, and false (default) otherwise

String origin

the origin of a different application if the request is being made on behalf of that application. 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
kotlin.NullPointerException kotlin.NullPointerException

If requestJson is null

kotlin.IllegalArgumentException kotlin.IllegalArgumentException

If requestJson is empty, or if it doesn't have a valid user.name defined according to the webauthn spec

Public methods

getClientDataHash

public final String getClientDataHash()

a hash that is used to verify the origin

getRequestJson

public final @NonNull String getRequestJson()

the request in JSON format in the standard webauthn web json.

preferImmediatelyAvailableCredentials

public final boolean preferImmediatelyAvailableCredentials()

true if you prefer the operation to return immediately when there is no available passkey registration offering instead of falling back to discovering remote options, and false (default) otherwise