Skip to content

feat: support aal2 gated enrollment - #10374

Merged
mathieuartu merged 3 commits into
mainfrom
feat/mfa-aal2-required
Sep 23, 2026
Merged

mathieuartu merged 3 commits into
mainfrom
feat/mfa-aal2-required

Conversation

@mathieuartu

@mathieuartu mathieuartu commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

References

Related to: https://consensyssoftware.atlassian.net/browse/MUL-2274

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes authentication/MFA enrollment token selection and error handling on security-sensitive paths; clients must handle aal2_required and step-up correctly to avoid enrollment failures.

Overview
Adds AAL2-gated MFA enrollment so enrolling a second or later credential can use an elevated access token. beginMfaEnrollment accepts an optional accessToken, and AuthenticationController.beginCredentialEnrollment passes the live step-up token from getElevatedProfileToken() when present; otherwise the base session token is used and the server may respond with aal2_required.

The MFA SDK is aligned with the latest auth API: new codes email_socially_verified, multi_primary_srp, and aal2_required (mapped to StepUpRequiredError), retry_after_seconds on error bodies (preferred over Retry-After for retryAfterMs), and HTTP 403. Changelog and MFA README note the step-up-and-retry flow for additional credentials.

Reviewed by Cursor Bugbot for commit 60e7d88. Bugbot is set up for automated code reviews on this repo. Configure here.

@mathieuartu mathieuartu self-assigned this Sep 22, 2026
@mathieuartu
mathieuartu requested review from a team as code owners September 22, 2026 20:09
@mathieuartu
mathieuartu deployed to default-branch September 22, 2026 20:09 — with GitHub Actions Active

@gantunesr gantunesr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just left one question

@mathieuartu
mathieuartu added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit 4c581ed Sep 23, 2026
137 checks passed
@mathieuartu
mathieuartu deleted the feat/mfa-aal2-required branch September 23, 2026 02:34
@NidhiKJha NidhiKJha mentioned this pull request Sep 23, 2026
3 of 4 tasks
pull Bot pushed a commit to Reality2byte/core that referenced this pull request Sep 23, 2026
## Explanation

Publish `@metamask/profile-sync-controller@32.3.0` so clients can
consume the additive changes that have accumulated on `main` since
32.2.0, including the `pairedIdentifierIds` field on `UserProfile` in
`srpSessionData` (MetaMask#10394).

Minor bump: the release only adds new, optional API surface (AAL2-gated
MFA enrollment, elevated tokens for credential enrollment,
`pairedIdentifierIds`) and bumps the internal `immer` dependency.
Nothing existing changes, so it is not breaking.

All 15 workspace packages that depend on
`@metamask/profile-sync-controller` now pin `^32.3.0`; none are being
published in this release. `yarn.lock` is updated accordingly.

## References

- Add `pairedIdentifierIds` to `UserProfile`:
MetaMask#10394
- MFA / AAL2 enrollment support:
MetaMask#10374
- Bump `immer` from `^9.0.6` to `^9.0.21`:
MetaMask#10331

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Releases auth/MFA and profile-session API surface; the diff is
dependency pins only, but consumers will pick up security-sensitive
behavior from 32.3.0.
> 
> **Overview**
> This release PR cuts **`@metamask/profile-sync-controller@32.3.0`**
(monorepo **`1280.0.0`**) and propagates it across the workspace. The
**15** packages that depend on profile sync now pin **`^32.3.0`** in
`package.json`, with matching **Unreleased** changelog notes and
**`yarn.lock`** updates; those dependents are **not** republished here.
> 
> The **32.3.0** changelog section documents what clients get from this
publish: **AAL2-gated MFA enrollment** (elevated `accessToken` for
`beginMfaEnrollment`, new MFA error codes / `StepUpRequiredError`,
`retry_after_seconds` handling), **`pairedIdentifierIds`** on
`UserProfile` in `srpSessionData`, and an internal **`immer`** bump. No
runtime code changes appear in this diff—only versioning and release
notes.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3a7ced6. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants