Repository navigation
Preserve Native Auth V2 unified-error diagnostics, Fixes AB#3784695 - #3307
Merged
Silviu Petrescu (spetrescu84) merged 7 commits intoOct 19, 2026
Merged
Conversation
Fixes AB#3784695 Keep raw suberrors and validated attribute details through parser and command results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
Fixes AB#3784695 Move diagnostic arguments into their authorize/continue/token APIError constructors; preserve errors-only scope behavior. Independently compiled and covered by focused MSAL/Common suites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753
|
✅ Work item link check complete. Description contains link AB#3784695 to an Azure Boards work item. |
|
✅ Work item link check complete. Description contains link AB#3784695 to an Azure Boards work item. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Controller-level diagnostic propagation lacks local regression coverage.
1 open finding
What changed in this PR
Preserves Native Auth V2 service diagnostics through Common’s parsing and controller layers for the paired MSAL unified-error work.
Changes:
- Adds suberror and attribute-validation diagnostics to V2 error results.
- Propagates diagnostics through parsers, controllers, and command results.
- Adds parser regression coverage for valid and malformed details.
| File | Description |
|---|---|
NativeAuthV2SignUpResponseParserTest.kt |
Tests diagnostic parsing. |
NativeAuthV2ResponseParser.kt |
Extracts and preserves diagnostics. |
NativeAuthV2InteractionApiResult.kt |
Extends interaction errors. |
AuthorizeChallengeApiResult.kt |
Extends authorization errors. |
ApiErrorResult.kt |
Adds shared validation details. |
NativeAuthV2CommandResult.kt |
Extends sign-up command errors. |
INativeAuthCommandResult.kt |
Extends generic API errors. |
NativeAuthV2FlowController.kt |
Forwards diagnostics through controllers. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Forward trace IDs, timestamps, numeric error codes, and token suberrors through response parsing and V2 command results. Preserve explicit-code precedence and cover typed, generic, and browser fallback mappings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55791345-e680-4927-a364-f6de503184be
Retain service-provided detail messages alongside validation codes and attribute IDs without changing error classification. Cover supported payload shapes and controller forwarding. 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: 495388ac-9812-45ec-9120-b110dcbe5903
Disha Janardhan (djanardhan98)
marked this pull request as ready for review
October 16, 2026 19:21
Disha Janardhan (djanardhan98)
requested a review
from a team
as a code owner
October 16, 2026 19:21
Silviu Petrescu (spetrescu84)
approved these changes
Oct 19, 2026
Silviu Petrescu (spetrescu84)
pushed a commit
to AzureAD/microsoft-authentication-library-for-android
that referenced
this pull request
Oct 19, 2026
…2618) ## Summary Unify Native Auth V2 terminal errors under `NativeAuthErrorV2`, matching AzureAD/microsoft-authentication-library-for-js#8900. - Remove the operation-specific V2 error classes without deprecated compatibility wrappers. - Expose stable classifiers on the shared error, distinguishing rejected credentials from new-password policy failures and invalid input. - Preserve service diagnostics, correlation, exceptions, and recoverable attribute-validation state. - Keep Native Auth V1 behavior unchanged. **Breaking V2 API change:** replace operation-specific error type checks with `NativeAuthErrorV2` and its classifiers. Fixes [AB#3784695](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3784695) ## Dependencies Requires the paired Common unified-error diagnostics PR: AzureAD/microsoft-authentication-library-common-for-android#3307. The Common gitlink points to `3265533f27d8c4054fc5b020ec0228bb872b8344`. Scopes/claims and OTP-service-validation changes are intentionally excluded. ## Validation Errors-only snapshot: **651 selected unit tests passed** (215 MSAL, 346 Common4j, 90 Common Android), with zero failures, errors, or skips in the final XML reports. The gate includes shared classifiers, wrong-password versus invalid-input mappings, diagnostic propagation, and standalone V1 regression coverage. 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 `/accounts` HTTP 429 attempt passed on the existing automatic retry; no assertions or retry configuration were changed. Live validation was executed against the final stacked errors plus scopes/claims sources, not the standalone errors snapshot. The live fixture overlay comes from #2601 and is not included in this feature PR. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753 Copilot-Session: 55791345-e680-4927-a364-f6de503184be Copilot-Session: 495388ac-9812-45ec-9120-b110dcbe5903 Copilot-Session: eafe5634-2142-4235-a7dc-d26bc1baa0d5
Disha Janardhan (djanardhan98)
added a commit
that referenced
this pull request
Oct 20, 2026
) ## Summary Port Common Native Auth V2 authorize-request inputs and related OTP parity from AzureAD/microsoft-authentication-library-for-js#8898. - Build on the existing authorize-challenge scope serialization and add initial claims propagation. - Include default OIDC scopes for sign-in, sign-up, and reset; canonicalize only recognized OIDC defaults while preserving resource scopes. - Preserve entry scopes for absent continuation inputs and honor explicitly empty continuation inputs. - Exclude claims from token serialization while retaining local metadata; keep scopes on token requests. - Allow empty OTP values to reach service validation and preserve existing password-to-email fallback and V1 behavior. **Approved wire policy:** scopes and optional claims at initial authorize-challenge, scopes without claims at token exchange, neither on other intermediate requests. This intentionally follows JS behavior rather than the work item's literal entry-only scope wording. Fixes [AB#3784690](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3784690) ## Dependencies Stacked on the separate Common unified-errors PR: #3307. Its base is the errors branch so the workstream diff stays isolated. Consumed by the paired MSAL authorize-inputs PR: AzureAD/microsoft-authentication-library-for-android#2619. Merge the errors dependency 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 and token paths, claims wire encoding, continuation scope retention/override, canonical OIDC defaults with preserved resource casing/duplicates, empty OTP 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 `/accounts` HTTP 429 attempt passed on the existing automatic retry; no assertions or retry configuration were changed. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Silviu Petrescu <spetrescu@microsoft.com> Copilot-Session: 0bcd671b-73fa-4ee6-bcd6-65d7eea4d753 Copilot-Session: eafe5634-2142-4235-a7dc-d26bc1baa0d5
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
Preserve Common diagnostics needed by the shared Android Native Auth V2 error surface, matching AzureAD/microsoft-authentication-library-for-js#8900.
Fixes AB#3784695
Dependencies
Consumed by the paired MSAL unified-errors PR: AzureAD/microsoft-authentication-library-for-android#2618.
Authorize-request scopes/claims changes are intentionally excluded.
Validation
Errors-only snapshot: 651 selected unit tests passed (215 MSAL, 346 Common4j, 90 Common Android), with zero failures, errors, or skips in the final XML reports.
The gate includes diagnostic parsing/forwarding and standalone V1 regression coverage.
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.Live validation was executed against the final stacked errors plus scopes/claims sources, not the standalone errors snapshot.