Skip to content

fix: MFA http contract parity fixes#2555

Open
tusharpandey13 wants to merge 5 commits intomainfrom
fix/mfa-http-contract-parity-breaking
Open

fix: MFA http contract parity fixes#2555
tusharpandey13 wants to merge 5 commits intomainfrom
fix/mfa-http-contract-parity-breaking

Conversation

@tusharpandey13
Copy link
Copy Markdown
Contributor

@tusharpandey13 tusharpandey13 commented Mar 13, 2026

Align MFA route handlers with Auth0 HTTP API contract.
Route handlers become transparent proxies: accept snake_case requests, return snake_case responses.
Camelization moves to SDK client boundary (ClientMfaClient, ServerMfaClient).

Changes

Wire Format

  • Token extraction: Authorization: Bearer header only (query param removed)
  • Camelization logic moved from business layer -> mfa client. This enables Auth0-like HTTP calls to and from the SDK's MFA proxy layer.
  • Renamed /auth/mfa/enroll/auth/mfa/associate (matches Auth0)

factorType: Added support for factorType instead of raw authenticatorTypes/oobChannels

Tests

888 pass, 0 fail (50 files)

…mfa_token in only headers; add support for factor_type; rename /auth/enroll to /auth/mfa/associate;
@tusharpandey13 tusharpandey13 requested a review from a team as a code owner March 13, 2026 10:13
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 81.50289% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.02%. Comparing base (b03e748) to head (0823b10).

Files with missing lines Patch % Lines
src/utils/mfa-transform-utils.ts 74.50% 13 Missing ⚠️
src/server/mfa/server-mfa-client.ts 0.00% 8 Missing ⚠️
src/utils/mfa-validation-utils.ts 33.33% 3 Missing and 5 partials ⚠️
src/server/auth-client.ts 92.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2555      +/-   ##
==========================================
- Coverage   90.08%   90.02%   -0.06%     
==========================================
  Files          63       63              
  Lines        7612     7687      +75     
  Branches     1613     1632      +19     
==========================================
+ Hits         6857     6920      +63     
- Misses        743      755      +12     
  Partials       12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tusharpandey13 tusharpandey13 changed the title fix: MFA http contract parity fixes (breaking) fix: MFA http contract parity fixes Mar 13, 2026
@gyaneshgouraw-okta
Copy link
Copy Markdown
Contributor

@tusharpandey13 in the PR description we should highlight breaking changes for customers under a breaking change section.
That would help community members visiting this PR.

Comment thread src/client/mfa/index.ts
route === "getAuthenticators" || url.includes("/authenticators");
const isChallenge = route === "challenge" || url.includes("/challenge");
const isVerify = route === "verify" || url.includes("/verify");
const isEnroll = route === "enroll" || url.includes("/enroll");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tusharpandey13 since /auth/mfa/enroll is updated to /auth/mfa/associate should this url.includes("/enroll") needs to be updated with url.includes("/associate")

Is the route update applicable here also ?

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.

3 participants