Skip to content

Fix Native Auth V2 server-directed authority routing - #3363

Open
Silviu Petrescu (spetrescu84) wants to merge 2 commits into
spetrescu/native-auth-v2-bugfix-remove-incorrect-mfa-statefrom
spetrescu/native-auth-v2-fix-authority-handling
Open

Silviu Petrescu (spetrescu84) wants to merge 2 commits into
spetrescu/native-auth-v2-bugfix-remove-incorrect-mfa-statefrom
spetrescu/native-auth-v2-fix-authority-handling

Conversation

@spetrescu84

Copy link
Copy Markdown
Contributor

Summary

Fix Native Auth V2 request routing after the initial authorize-challenge response.

  • Resolve returned relative API paths against the configured authority origin, preserving the returned tenant ID or tenant domain and raw query string.
  • Follow the returned continue link for subsequent authorize-challenge calls instead of reconstructing the configured endpoint. Fail when the required link is missing.
  • Retain configured dc on the initial request, but never inject it into server-returned links, including links that omit dc.
  • Follow returned absolute HTTPS URLs, including a different origin, with correlation-aware warnings for authority/tenant and test-slice mismatches. Warnings do not include URL or query values.
  • Preserve existing token endpoint routing and URL validation for malformed paths, user-info, fragments, and insecure non-mock links.
  • Add regression coverage for custom and CIAM domains, tenant ID/domain combinations, encoded and repeated query parameters, continuation links, warnings, and dispatched HTTP URLs.

Dependency

Stacked on AzureAD/microsoft-authentication-library-common-for-android#3344 (spetrescu/native-auth-v2-bugfix-remove-incorrect-mfa-state) so this PR contains only the authority-routing changes.

Validation

Run from the MSAL Android repository root with JDK 17 against the local Common sources:

  • 675 targeted tests passed: 311 Common JVM protocol/configuration tests, 143 Common V2 controller tests, and 221 MSAL V2 consumer tests.
  • :msal:assembleLocalDebug passed, including PMD.
  • :common4j:spotbugsMain passed.
  • Diff whitespace checks passed, respecting the existing CRLF files.

Full test/coverage suites, Android lint, device/instrumented tests, live network authentication, and cross-app UI E2E were not run. Targeted unit tests and packaging do not establish live authentication success.

No MSAL source or submodule-pin changes are included.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

…ate' into spetrescu/native-auth-v2-fix-authority-handling
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.

1 participant