Skip to content

Validate explicitly requested age-assurance target receipts - #3350

Draft
Mohammed El-Masry (melmasry) wants to merge 8 commits into
AzureAD:devfrom
melmasry:mohaibrahim/msal-aa-target-validation
Draft

Mohammed El-Masry (melmasry) wants to merge 8 commits into
AzureAD:devfrom
melmasry:mohaibrahim/msal-aa-target-validation

Conversation

@melmasry

@melmasry Mohammed El-Masry (melmasry) commented Nov 12, 2026 •

Copy link
Copy Markdown

Summary

Proposes request-bound regulatory-target receipt validation for explicit target-* strings in the id_token.xms_agvs.additionalProperties array. Validate the returned ID-token xms_agvt comma-separated identity set, ignoring case/order. Missing, malformed, duplicate, extra, or wrong identities fail with age_assurance_target_mismatch, including at xms_agvs=0.

The +/- prefixes describe outcomes, not cryptographic signatures. A matching negative receipt is valid binding, not adulthood or authorization. all is literal; access tokens remain opaque; untargeted requests retain existing behavior.

Network, cached, broker, command-dispatch, and Native Auth result boundaries retain operation-local request binding. Local and Native Auth cache hits now reject mismatches before refresh-on scheduling. Regression coverage asserts no refresh dispatch, token request, or cache removal after a mismatch.

Cache contract and decisions

  1. Locked: fail closed; no automatic recovery, cache eviction, or validation bypass. Explicit targets are the opt-in; no additional flag.
  2. Locked: this change does not add claims-partitioned Android caching. Existing explicit-claims force-refresh behavior is retained; an AT-only claims field is not evidence that normal Android acquisition populates/filters it. ID/refresh tokens are not newly partitioned.
  3. Open / merge gate: SDK-owner agreement on validation placement, error/recovery behavior, broker compatibility, and shipping/dependency strategy. The SDK cannot undo persistence owned by an external broker.

Dependencies and latest base

Merged upstream dev at 5a8845a1a266cf174aeb67ff41569a588caaf413. Coordinate with Android wrapper validation AzureAD/microsoft-authentication-library-for-android#2652 and preservation https://github.com/AzureAD/microsoft-authentication-library-for-android/pull/2651. Preservation must land before the coordinated rollout.

Primary Android PBI: AB#3826674

Related cross-SDK task: AB#3810655

Validation and blockers

Diff, ancestry, and static checks passed. Current focused Gradle test/lint attempts stopped before execution because Java was unavailable to Gradle; Android SDK and Azure-feed credential configuration are also absent. No current compile, unit-test, or lint pass is claimed. Authenticated Android/JDK CI remains required.

Draft only: design gates and required CI remain open.

<!-- BEGIN pr-telemetry -->
assistance: agentic-cli
type: feature
agent-tool: copilot-cli
agent-model: gpt-6-astra
work-item: [AB#3826674](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3826674)
<!-- END pr-telemetry -->

Validate explicit ID-token targets before network/native persistence and cached or broker success delivery. Preserve untargeted behavior and signed outcome semantics without interpreting status or authorizing API access.

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

Copilot-Session: 9a578d00-478b-4bfb-8ff5-843d86627760
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9a578d00-478b-4bfb-8ff5-843d86627760
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9a578d00-478b-4bfb-8ff5-843d86627760
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9a578d00-478b-4bfb-8ff5-843d86627760
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9a578d00-478b-4bfb-8ff5-843d86627760
Validate a cached local result before refresh-on can schedule background acquisition. Cover exact array/string request opt-in and both local cache-hit branches; clarify fail-closed recovery and shared cache boundaries.

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

Copilot-Session: 9a578d00-478b-4bfb-8ff5-843d86627760
Reject a mismatched cached ID token before Native Auth schedules refresh-on, matching the local controller boundary. Exercise both controllers and both cache-hit branches through the shared regression fixture.

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

Copilot-Session: 9a578d00-478b-4bfb-8ff5-843d86627760
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