Skip to content

feat(auth0-auth-js): add multi-factor authentication (MFA) support#179

Merged
amitsingh05667 merged 1 commit into
mainfrom
feat/mfa-auth-js
Jun 2, 2026
Merged

feat(auth0-auth-js): add multi-factor authentication (MFA) support#179
amitsingh05667 merged 1 commit into
mainfrom
feat/mfa-auth-js

Conversation

@amitsingh05667

@amitsingh05667 amitsingh05667 commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

  • New verify method - exchange MFA token + code for access tokens (otp, oob, recovery-code)
  • Added clientSecret support to challengeAuthenticator
  • Added getConfiguration option for openid-client integration
  • OAuth2Error extended with mfa_token and mfa_requirements
  • New isMfaRequiredError(error) type guard to detect mfa_required responses
  • Exposes authClient.mfa
  • Token errors now propagate mfa_token and mfa_requirements when Auth0 returns mfa_required

Design decisions

  • MfaClient (src/mfa/): New verify method — exchange MFA token + code for access tokens (otp, oob, recovery-code); Added clientSecret support to challengeAuthenticator; Added getConfiguration option for openid-client integration
  • errors.ts: OAuth2Error extended with mfa_token and mfa_requirements; New isMfaRequiredError(error) type guard to detect mfa_required responses
  • AuthClient: Exposes authClient.mfa; Token errors now propagate mfa_token and mfa_requirements when Auth0 returns mfa_required

Test plan

  • 33 unit tests covering all MFA operations (listAuthenticators, enrollAuthenticator, deleteAuthenticator, challengeAuthenticator, verify)
  • verify method coverage flows
  • npm run build passes

@amitsingh05667 amitsingh05667 changed the title feat: add MFA support to auth0-auth-js feat: add multi-factor authentication (MFA) support Jun 1, 2026
@nandan-bhat

Copy link
Copy Markdown
Contributor

Approving this PR, as this the same PR (#164) isolating auth0-auth-js changes in a separate PR.

@amitsingh05667 amitsingh05667 changed the title feat: add multi-factor authentication (MFA) support feat(auth0-auth-js): add multi-factor authentication (MFA) support Jun 2, 2026
@amitsingh05667 amitsingh05667 merged commit 4cf0944 into main Jun 2, 2026
6 checks passed
@amitsingh05667 amitsingh05667 deleted the feat/mfa-auth-js branch June 2, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants