Class implementing the mfa-webauthn-roaming-enrollment screen functionality.
This screen is displayed when a user needs to enroll a WebAuthn roaming authenticator (like a security key).
Example
Copy
import MfaWebAuthnRoamingEnrollment from '@auth0/auth0-acul-js/mfa-webauthn-roaming-enrollment';const webauthnEnrollment = new MfaWebAuthnRoamingEnrollment();// Assuming you have obtained the WebAuthn credential response (e.g., from navigator.credentials.create)const credentialResponse = { /* ... serialized credential ... */ };await webauthnEnrollment.enroll({ response: JSON.stringify(credentialResponse) });
Initiates the WebAuthn credential creation and submits the result to the server.
This corresponds to the user interacting with the FIDO Security Keys prompt.
Example
Copy
import MfaWebAuthnRoamingEnrollment from '@auth0/auth0-acul-js/mfa-webauthn-roaming-enrollment';const webauthnEnrollment = new MfaWebAuthnRoamingEnrollment();// Assuming you have obtained the WebAuthn credential response (e.g., from navigator.credentials.create)const credentialResponse = { /* ... serialized credential ... */ };await webauthnEnrollment.enroll({ response: JSON.stringify(credentialResponse) });
Submits details about a WebAuthn browser error to the server.
This is used when the browser’s WebAuthn API encounters an error.
Example
Copy
import MfaWebAuthnRoamingEnrollment from '@auth0/auth0-acul-js/mfa-webauthn-roaming-enrollment';const webauthnEnrollment = new MfaWebAuthnRoamingEnrollment();await webauthnEnrollment.showError({ error: { name: 'NotAllowedError', message: 'The operation either timed out or was not allowed.', },});
Allows the user to try another MFA method.
This corresponds to the “Try Another Method” button.
Example
Copy
import MfaWebAuthnRoamingEnrollment from '@auth0/auth0-acul-js/mfa-webauthn-roaming-enrollment';const webauthnEnrollment = new MfaWebAuthnRoamingEnrollment();await webauthnEnrollment.tryAnotherMethod();