Skip to content

WebAuthnP256.getCredentialCreationOptions

Returns the creation options for a P256 WebAuthn Credential to be used with the Web Authentication API.

Imports

Named
import { WebAuthnP256 } from 'ox'

Examples

import { WebAuthnP256 } from 'ox'
 
const options = WebAuthnP256.getCredentialCreationOptions({ name: 'Example' })
 
const credential = await window.navigator.credentials.create(options)

Definition

function getCredentialCreationOptions(
  options: getCredentialCreationOptions.Options,
): internal.CredentialCreationOptions

Source: src/WebAuthnP256.ts

Parameters

options

  • Type: getCredentialCreationOptions.Options

Options.

options.attestation

  • Type: AttestationConveyancePreference
  • Optional

A string specifying the relying party's preference for how the attestation statement (i.e., provision of verifiable evidence of the authenticity of the authenticator and its data) is conveyed during credential creation.

options.authenticatorSelection

  • Type: AuthenticatorSelectionCriteria
  • Optional

An object whose properties are criteria used to filter out the potential authenticators for the credential creation operation.

options.challenge

  • Type: BufferSource
  • Optional

An ArrayBuffer, TypedArray, or DataView used as a cryptographic challenge.

options.displayName

  • Type: string
  • Optional

options.excludeCredentialIds

  • Type: readonly string[]
  • Optional

List of credential IDs to exclude from the creation. This property can be used to prevent creation of a credential if it already exists.

options.extensions

  • Type: AuthenticationExtensionsClientInputs
  • Optional

List of Web Authentication API credentials to use during creation or authentication.

options.id

  • Type: BufferSource
  • Optional

options.name

  • Type: string

options.rp

  • Type: { id: string; name: string; }
  • Optional

An object describing the relying party that requested the credential creation

options.timeout

  • Type: number
  • Optional

A numerical hint, in milliseconds, which indicates the time the calling web app is willing to wait for the creation operation to complete.

options.user

  • Type: { displayName?: string; id?: BufferSource; name: string; }

An object describing the user account for which the credential is generated.

Return Type

The credential creation options.

internal.CredentialCreationOptions

Error Type

WebAuthnP256.getCredentialCreationOptions.ErrorType