@auth0/auth0-acul-js - v0.1.0-beta.5
    Preparing search index...

    Class MfaWebAuthnPlatformEnrollment

    MfaWebAuthnPlatformEnrollment

    Hierarchy

    • BaseContext
      • MfaWebAuthnPlatformEnrollment

    Implements

    Index

    Constructors

    Properties

    screenIdentifier: string = ScreenIds.MFA_WEBAUTHN_PLATFORM_ENROLLMENT

    static

    Methods

    • Initiates the WebAuthn platform credential creation process using the public key options available on this.screen.publicKey and submits the resulting credential to the server. This method internally calls createPasskeyCredentials (which wraps navigator.credentials.create()).

      Parameters

      Returns Promise<void>

      A promise that resolves when the credential is successfully created and submitted.

      Throws an error if this.screen.publicKey is not available, if createPasskeyCredentials fails (e.g., user cancellation, hardware issues), or if the submission to the server fails.

      // Assuming 'sdk' is an instance of MfaWebAuthnPlatformEnrollment
      try {
      await sdk.submitPasskeyCredential(); // No need to pass publicKey explicitly
      // On success, Auth0 handles redirection.
      } catch (error) {
      console.error('Passkey enrollment failed:', error);
      if (error.name && error.message) { // Check if it looks like a WebAuthn error
      await sdk.reportBrowserError({ error: { name: error.name, message: error.message } });
      }
      }