Class FRWebAuthnAbstract

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);
}

Constructors

Methods

  • Populates the step with the necessary authentication outcome.

    Parameters

    • step: FRStep

      The step that contains WebAuthn authentication data

    Returns Promise<FRStep>

    The populated step

  • 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

    Returns Promise<FRStep>

  • Returns the WebAuthn metadata callback containing data to pass to the browser Web Authentication API.

    Parameters

    • step: FRStep

      The step that contains WebAuthn callbacks

    Returns undefined | MetadataCallback

    The metadata callback

  • Retrieves the credential from the browser Web Authentication API.

    Parameters

    • options: PublicKeyCredentialRequestOptions

      The public key options associated with the request

    Returns Promise<null | PublicKeyCredential>

    The credential

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

    Parameters

    • credential: null | 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}`

    The outcome string

  • Retrieves the credential from the browser Web Authentication API.

    Parameters

    • options: PublicKeyCredentialCreationOptions

      The public key options associated with the request

    Returns Promise<null | PublicKeyCredential>

    The credential

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

    Parameters

    • credential: null | PublicKeyCredential

      The credential to convert

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

    The outcome string

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

    Parameters

    Returns PublicKeyCredentialRequestOptions

    The Web Authentication API request options

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

    Parameters

    Returns PublicKeyCredentialCreationOptions

    The Web Authentication API request options