files/en-us/web/api/publickeycredentialrequestoptions/index.md
{{APIRef("Web Authentication API")}}{{securecontext_header}}
The PublicKeyCredentialRequestOptions dictionary represents the object passed to {{domxref("CredentialsContainer.get()")}} as the value of the publicKey option.
It is used to request a {{domxref("PublicKeyCredential")}} provided by an {{glossary("authenticator")}} that supports the Web Authentication API.
allowCredentials {{optional_inline}}
: An array of objects used to restrict the list of acceptable credentials. An empty array indicates that any credential is acceptable.
Each object in the array will contain the following properties:
id
get() call.transports {{optional_inline}}
: An array of strings providing hints as to the methods the client could use to communicate with the relevant authenticator of the public key credential to retrieve. Possible transports are: "ble", "hybrid", "internal", "nfc", and "usb".
[!NOTE] This value is mirrored by the return value of the {{domxref("AuthenticatorAttestationResponse.getTransports", "PublicKeyCredential.response.getTransports()")}} method of the {{domxref("PublicKeyCredential")}} object returned by the
create()call that originally created the credential. At that point, it should be stored by the app for later use.
type
"public-key", but more values may be added in the future. This value is mirrored by the {{domxref("Credential.type", "type")}} property of the {{domxref("PublicKeyCredential")}} object returned by a successful get() call.This value defaults to an empty array.
challenge
get() call).extensions {{optional_inline}}
: An object containing properties representing the input values for any requested extensions. These extensions are used to specific additional processing by the client or authenticator during the authentication process. Examples include dealing with legacy FIDO API credentials, and evaluating outputs from a pseudo-random function (PRF) associated with a credential.
Extensions are optional and different browsers may recognize different extensions. Processing extensions is always optional for the client: if a browser does not recognize a given extension, it will just ignore it. For information on using extensions, and which ones are supported by which browsers, see Web Authentication extensions.
hints {{optional_inline}} {{experimental_inline}}
: An array of strings providing hints as to what UI the browser should provide for the user to authenticate with an existing public key credential.
The strings can be any of the following:
"security-key"
"client-device"
"hybrid"
When multiple strings are included in the array, their order denotes the order of preference, from high to low. Supporting browsers that respect the hints should use the first one that they understand.
Specified hints may contradict hints provided in the transports option. When the provided hints contradict this option, the hints take precedence. hints may also be ignored by the browser under specific circumstances, for example if a hinted authenticator type is not usable on the user's device.
For some specific code and UI examples, see Introducing hints, Related Origin Requests and JSON serialization for WebAuthn in Chrome.
rpId {{optional_inline}}
: A string that specifies the relying party's identifier (for example "login.example.org"). For security purposes:
rpId matches the relying party's origin or is a domain suffix of the relying party's origin (for example, example.org).rpId matches the rpId of the credential used for the authentication ceremony.This value defaults to the current origin's domain.
timeout {{optional_inline}}
userVerification {{optional_inline}}
: A string specifying the relying party's requirements for user verification of the authentication process. This verification is initiated by the authenticator, which will request the user to provide an available factor (for example a PIN or a biometric input of some kind).
The value can be one of the following:
"required"
"preferred"
"discouraged"
This value defaults to "preferred".
{{Specifications}}
{{Compat}}