Utility for integrating a web browser's WebAuthn API.

Example:

// Determine if a step is a WebAuthn step
const stepType = FRWebAuthn.getWebAuthnStepType(step);
if (stepType === WebAuthnStepType.Registration) {
// Register a new device
await FRWebAuthn.register(step);
} else if (stepType === WebAuthnStepType.Authentication) {
// Authenticate with a registered device
await FRWebAuthn.authenticate(step);
}

Hierarchy

  • FRWebAuthn

Methods

  • Populates the step with the necessary authentication outcome.

    Returns

    The populated step

    Parameters

    • step: FRStep

      The step that contains WebAuthn authentication data

    Returns Promise<FRStep>

  • Can make this generic const in Typescript 5.0 > and the name itself will be inferred from the type so typeof deviceName will not just return string but the actual name of the deviceName passed in as a generic.

    Type Parameters

    • T extends string = ""

    Parameters

    • step: FRStep
    • Optional deviceName: T

    Returns Promise<FRStep>

  • Retrieves the credential from the browser Web Authentication API.

    Returns

    The credential

    Parameters

    • options: PublicKeyCredentialRequestOptions

      The public key options associated with the request

    Returns Promise<PublicKeyCredential>

  • Converts an authentication credential into the outcome expected by OpenAM.

    Returns

    The outcome string

    Parameters

    • credential: PublicKeyCredential

      The credential to convert

    Returns `${string}::direct::${string}` | `${string}::indirect::${string}` | `${string}::none::${string}` | `${string}::direct::${string}::${string}` | `${string}::indirect::${string}::${string}` | `${string}::none::${string}::${string}`

  • Retrieves the credential from the browser Web Authentication API.

    Returns

    The credential

    Parameters

    • options: PublicKeyCredentialCreationOptions

      The public key options associated with the request

    Returns Promise<PublicKeyCredential>

  • Converts a registration credential into the outcome expected by OpenAM.

    Returns

    The outcome string

    Parameters

    • credential: PublicKeyCredential

      The credential to convert

    Returns `${string}::direct::${string}` | `${string}::indirect::${string}` | `${string}::none::${string}`

  • Converts authentication tree metadata into options required by the browser Web Authentication API.

    Returns

    The Web Authentication API request options

    Parameters

    Returns PublicKeyCredentialRequestOptions

  • Converts authentication tree metadata into options required by the browser Web Authentication API.

    Returns

    The Web Authentication API request options

    Parameters

    Returns PublicKeyCredentialCreationOptions

Constructors