Passer au contenu principal
Classe qui implémente les fonctionnalités de l’écran mfa-webauthn-roaming-enrollment. Cet écran est affiché lorsqu’un utilisateur doit inscrire un authentificateur WebAuthn itinérant (comme une clé de sécurité).
Example
import MfaWebAuthnRoamingEnrollment from '@auth0/auth0-acul-js/mfa-webauthn-roaming-enrollment';

const webauthnEnrollment = new MfaWebAuthnRoamingEnrollment();
// En supposant que vous avez obtenu la réponse d'identification WebAuthn (p. ex., de navigator.credentials.create)
const credentialResponse = { /* ... serialized credential ... */ };
await webauthnEnrollment.enroll({ response: JSON.stringify(credentialResponse) });

Constructeurs

MfaWebAuthnRoamingEnrollment
Constructor
Crée une instance du gestionnaire d’écran pour MfaWebAuthnRoamingEnrollment.

Propriétés

branding
client
organization
prompt
screen
tenant
transaction
untrustedData
user
screenIdentifier
string

Méthodes

enroll
Promise<void>
Lance la création des identifiants WebAuthn et en soumet le résultat au serveur. Cela correspond à l’interaction de l’utilisateur avec l’invite FIDO Security Keys.
Example
import MfaWebAuthnRoamingEnrollment from '@auth0/auth0-acul-js/mfa-webauthn-roaming-enrollment';

const webauthnEnrollment = new MfaWebAuthnRoamingEnrollment();
// En supposant que vous avez obtenu la réponse d’identifiant WebAuthn (p. ex., à partir de navigator.credentials.create)
const credentialResponse = { /* ... serialized credential ... *&#x2F; };
await webauthnEnrollment.enroll({ response: JSON.stringify(credentialResponse) });
getErrors
Récupère le tableau des erreurs de transaction à partir du contexte, ou un tableau vide s’il n’en existe aucune.Un tableau d’objets d’erreur provenant du contexte de transaction.
showError
Promise<void>
Soumet au serveur les détails d’une erreur WebAuthn du navigateur. Cette méthode est utilisée lorsque l’API WebAuthn du navigateur rencontre une erreur.
Example
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.',
  },
});
tryAnotherMethod
Promise<void>
Permet à l’utilisateur d’essayer une autre méthode d’AMF (MFA). Cela correspond au bouton « Try Another Method ».
Example
import MfaWebAuthnRoamingEnrollment from '@auth0/auth0-acul-js/mfa-webauthn-roaming-enrollment';

const webauthnEnrollment = new MfaWebAuthnRoamingEnrollment();
await webauthnEnrollment.tryAnotherMethod();