Repository navigation
Add Native Auth V2 authorize scopes and claims, Fixes AB#3784690 - #2624
Merged
Disha Janardhan (djanardhan98) merged 15 commits intoOct 21, 2026
Merged
Disha Janardhan (djanardhan98) merged 15 commits into
Disha Janardhan (djanardhan98) merged 15 commits into
Conversation
Fixes AB#3784695 Remove operation-specific V2 error classes without deprecated wrappers. Preserve recoverable states and raw diagnostics; distinguish credentials from new-password policy. Pair with the Common diagnostic-propagation commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
Fixes AB#3784695 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
Fixes AB#3784690 Thread typed entry claims and scopes through public APIs and adapters, snapshot callback inputs, and retain null-versus-empty continuation semantics. Include JS8898 empty/short OTP service-validation parity. Token retains scope and omits claims; V1 is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
Fixes AB#3784695 Rejected credentials are invalid credentials; empty password input is invalid input. Use independently validated Common diagnostic-forwarding repair. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
Fixes AB#3784695 Rejected credentials are invalid credentials; empty password input is invalid input. Use independently validated Common diagnostic-forwarding repair. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753 (cherry picked from commit 7ac5b2d)
Fixes AB#3784690 Use the Common scope-canonicalization fix validated with MSAL/Common focused suites; retain carried unified-error repair and existing scopes/claims wire policy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
Fixes AB#3784690 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
Preserve service trace IDs, timestamps, and numeric codes across V2 public error mappings. Keep password-policy classification independent of credential classification, correct sign-up documentation, and pair the updated Common commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55791345-e680-4927-a364-f6de503184be
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 495388ac-9812-45ec-9120-b110dcbe5903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eafe5634-2142-4235-a7dc-d26bc1baa0d5
Resolve the Common submodule conflict with the paired authorize-inputs merge, retaining scopes, claims, and current unified-error diagnostics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eafe5634-2142-4235-a7dc-d26bc1baa0d5
Disha Janardhan (djanardhan98)
marked this pull request as ready for review
October 19, 2026 20:10
Silviu Petrescu (spetrescu84)
previously approved these changes
Oct 20, 2026
Disha Janardhan (djanardhan98)
changed the base branch from
djanardhan/native-auth-v2-unified-errors
to
dev
October 20, 2026 16:30
Disha Janardhan (djanardhan98)
dismissed
Silviu Petrescu (spetrescu84)’s stale review
October 20, 2026 16:30
The base branch was changed.
Disha Janardhan (djanardhan98)
enabled auto-merge (squash)
October 20, 2026 17:27
Preserve Native Auth V2 scopes, claims, and service-side OTP validation while resolving conflicts with dev. Update Common to 0bf4510df6fd0257fb359267635223640ce31dcb. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15870531-a0a1-4433-91b7-7cde867b4083
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Claims snapshot failures can bypass callback delivery and leave owned password copies uncleared.
1 open issue
What changed in this PR
Adds scopes and typed claims support to Native Auth V2 entry flows, alongside the paired Common changes, while preserving V1 behavior.
Changes:
- Propagates authorize inputs and snapshots mutable callback parameters.
- Delegates empty OTP validation to the service.
- Adds regression coverage and documents continuation scope behavior.
| File | Description |
|---|---|
| msal/src/test/java/com/microsoft/identity/nativeauth/v2/NativeAuthV2SignUpTest.kt | Tests scope and claims snapshots. |
| msal/src/test/java/com/microsoft/identity/nativeauth/v2/NativeAuthV2SignInTest.kt | Tests snapshots and MFA OTP submission. |
| msal/src/test/java/com/microsoft/identity/nativeauth/v2/NativeAuthV2InterfaceKotlinTest.kt | Tests input propagation, V1 compatibility, and OTP submission. |
| msal/src/main/java/com/microsoft/identity/nativeauth/statemachine/states/MFAVerificationRequiredStateV2.kt | Removes local empty-challenge rejection. |
| msal/src/main/java/com/microsoft/identity/nativeauth/statemachine/states/CodeRequiredStateV2.kt | Removes local empty-code rejection. |
| msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthSignUpParameters.kt | Adds optional scopes and claims. |
| msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthSignInContinuationParameters.kt | Documents continuation input semantics. |
| msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthResetPasswordParameters.kt | Adds optional scopes and claims. |
| msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplication.kt | Propagates and snapshots entry inputs. |
| msal/src/main/java/com/microsoft/identity/client/internal/CommandParametersAdapter.java | Adds scopes-and-claims adapter overloads. |
| changelog | Documents V2 authorize-input behavior. |
Review effort: Balanced
Return CLIENT_EXCEPTION results on the PCA scope when synchronous input snapshots fail. Clear owned password copies immediately on snapshot failure or cancellation without modifying caller buffers, and preserve callback exception routing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 15870531-a0a1-4433-91b7-7cde867b4083
Silviu Petrescu (spetrescu84)
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Port Android Native Auth V2 authorize-request inputs and related OTP parity from AzureAD/microsoft-authentication-library-for-js#8898.
Approved wire policy: send scopes and optional claims on the initial authorize-challenge; send scopes but no claims on token exchange. Intermediate requests send neither. This intentionally follows JS behavior rather than the work item's literal entry-only scope wording.
Fixes AB#3784690
Dependencies
Stacked on the separate MSAL unified-errors PR: #2618. Its base is the errors branch so this diff contains only the scopes/claims workstream.
Requires the paired Common authorize-inputs PR: AzureAD/microsoft-authentication-library-common-for-android#3308.
The Common gitlink points to
b41473a29fd7e519108b0630526e652996e38f9f.Merge the errors dependencies first, then retarget this PR to
dev.Validation
Scopes/claims snapshot: 661 selected unit tests passed (218 MSAL, 349 Common4j, 94 Common Android), with zero failures, errors, or skips in the final XML reports.
Coverage includes all three initial entries, callback input snapshots, continuation scope retention/override, canonical OIDC defaults on entry and token requests, empty/short OTP service submission, and standalone V1 regressions.
Final integrated-stack PR2601 validation: 20 live signup/reset E2E tests and 4 recorder tests passed, with 3 known duplicate-account service-test skips. One Mail.tm
/accountsHTTP 429 attempt passed on the existing automatic retry; no assertions or retry configuration were changed.The live fixture overlay comes from #2601 and is not included in this feature PR.