Skip to content

AB#3715428: WI-2 Implement WAM DPoP routing outcome handling and cache policy - #8789

Merged
Hector Morales (hectormmg) merged 110 commits into
devfrom
copilot/ab-3715428-wam-dpop-outcome-handling
Nov 4, 2026
Merged

Hector Morales (hectormmg) merged 110 commits into
devfrom
copilot/ab-3715428-wam-dpop-outcome-handling

Conversation

@hectormmg

@hectormmg Hector Morales (hectormmg) commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements WAM brokered DPoP routing and response-driven L3/L1 outcome handling with fail-closed validation and request-bound proof cache policy.

Implements

Verified broker contract

  • Outgoing WAM DPoP requests use tokenType=dpop+proof with reqCnf, preferBinding=attested, method, and URI context.
  • The active extension response contract uses properties.token_type, properties.DPoP, and properties.binding_attested.
  • properties.token_type=dpop+proof identifies an L3 broker-proof outcome; properties.token_type=DPoP identifies L1 fallback to the caller-owned key.
  • DOM DPoP is not enabled. Routing falls back to browser DPoP, and the DOM handler defensively rejects DPoP before executeGetToken if invoked directly.

Acceptance criteria (AB#3715428)

  • DPoP WAM requests include tokenType=dpop+proof, reqCnf, preferBinding, method, and URI context.
  • Extension responses are interpreted from the canonical DPoP property bag; DOM DPoP remains gated before broker IPC.
  • L3 WAM tokens are not cached by MSAL.
  • L1 fallback locally signs only when request context proves MSAL owns the key.
  • Unknown, malformed, contradictory, ambiguous, and cross-scheme responses fail closed.

How to validate

  • L3 dpop+proof outcomes return properties.DPoP without local signing or access-token caching.
  • L1 DPoP fallback signs locally only with an MSAL-owned key and retains key-partitioned cache behavior.
  • Unknown, malformed, contradictory, ambiguous, and cross-scheme outcomes fail before cache mutation.
  • Existing Bearer, PoP/SHR, DOM, and extension behavior remains compatible.

Validation

  • All 78 required PR checks pass, including the WAM broker E2E lane, DPoP E2E, build/test, SDL, analysis, and Beachball.
  • Latest focused PlatformAuthInteractionClient suite: 151 passed.
  • Type build, lint, formatting, API Extractor, and git diff --check passed; lint reports only pre-existing warnings.
  • No unresolved review threads remain.

Bundle impact

The official minified msal-browser bundle increases by 11,191 bytes raw, 2,334 bytes gzip, and 1,883 bytes Brotli versus origin/dev (+3.84%, +3.21%, and +3.09%, respectively).

Created by Forge create-pr and validated for human review.

assistance: agentic-cli
type: feature
agent-tool: copilot-cli
agent-model: gpt-5.6-sol
work-item: AB#3715428

Add WAM broker request and response contract fields for platform brokered DPoP. Keep shared platform auth requests canonical and map extension-only no-cache PoP parameters at the extension transport boundary.

Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Map DPoP binding request and response fields through the platform authentication DOM contract.

Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
Add WAM broker request and response contract fields for platform brokered DPoP. Keep shared platform auth requests canonical and map extension-only no-cache PoP parameters at the extension transport boundary.

Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Map DPoP binding request and response fields through the platform authentication DOM contract.

Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78f9666b-ef4d-4799-bc77-e060b95c5158
Implement AB#3715428 WAM DPoP routing, fail-closed outcome handling, proof selection, and cache policy.

Co-authored-by: Forge <forge-bot@entra.github.io>

Forge-Agent: Developer

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

Copilot-Session: 78f9666b-ef4d-4799-bc77-e060b95c5158
Copilot AI lite review requested due to automatic review settings August 25, 2026 21:01
@hectormmg
Hector Morales (hectormmg) requested a review from a team as a code owner August 25, 2026 21:01
@hectormmg Hector Morales (hectormmg) added agentic-cli Copilot CLI / terminal agent drove the bulk of the edits feature Feature requests. labels Aug 25, 2026
@hectormmg Hector Morales (hectormmg) changed the title AB#3715428: WI-2 Implement WAM DPoP routing outcome handling and cache policy [forge-iterating] AB#3715428: WI-2 Implement WAM DPoP routing outcome handling and cache policy Aug 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements platform broker (WAM/DOM/extension) DPoP request/response handling in @azure/msal-browser, including outcome validation (L3 broker proof vs L1 local-sign fallback) and updated request mapping for proof context. Also exposes the shared DpopProofGenerator via the msal-common browser entrypoint for internal consumption.

Changes:

  • Adds DPoP routing/outcome validation and proof generation behavior to PlatformAuthInteractionClient (including new broker request fields like tokenType="dpop_proof", preferBinding, reqCnf, and proof-context propagation).
  • Extends native broker request/response contracts to carry DPoP-specific fields across Extension + DOM broker paths.
  • Adds/updates test coverage for L3/L1 outcomes and no-cache proof context mapping; adds beachball changefiles.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/msal-common/src/exports-browser-only.ts Exports DpopProofGenerator from the browser-only entrypoint.
lib/msal-common/apiReview/msal-common.api.md Adds API review surface for DpopProofGenerator (internal).
lib/msal-browser/src/interaction_client/PlatformAuthInteractionClient.ts Core DPoP broker request preparation, outcome validation, proof generation, and key cleanup logic.
lib/msal-browser/src/broker/nativeBroker/PlatformAuthRequest.ts Adds preferBinding and extraParametersNoCache to the broker request types.
lib/msal-browser/src/broker/nativeBroker/PlatformAuthResponse.ts Adds DPoP fields to broker response types (token type, proof, binding key id, attestation flag).
lib/msal-browser/src/broker/nativeBroker/PlatformAuthProvider.ts Allows platform auth for the DPoP authentication scheme.
lib/msal-browser/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts Maps proof context into extraParametersNoCache for extension IPC; removes PII-heavy trace logging.
lib/msal-browser/src/broker/nativeBroker/PlatformAuthDOMHandler.ts Maps proof binding fields for DOM broker requests/responses; removes PII logging on stringify failures.
lib/msal-browser/test/interaction_client/PlatformAuthInteractionClient.spec.ts Adds interaction tests for L3/L1 outcomes, cache mutation expectations, and validation failure cases.
lib/msal-browser/test/broker/PlatformAuthProvider.spec.ts Updates provider expectations to allow DPoP when initialized.
lib/msal-browser/test/broker/PlatformAuthExtensionHandler.spec.ts Extends extension IPC contract tests for DPoP request/response fields.
lib/msal-browser/test/broker/PlatformAuthDOMHandler.spec.ts Adds DOM mapping tests for DPoP request/response fields; adjusts PII logging expectations.
change/@azure-msal-browser-wam-dpop-outcomes.json Beachball changefile for WAM DPoP outcomes/caching policy.
change/@azure-msal-browser-platform-broker-dpop.json Beachball changefile for platform broker DPoP contract support.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@hectormmg
Hector Morales (hectormmg) changed the base branch from dev to copilot/ab-3715427-wam-dpop-contract-types August 25, 2026 21:47
@hectormmg
Hector Morales (hectormmg) requested a review from a team as a code owner August 25, 2026 21:47
Add WAM broker request and response contract fields for platform brokered DPoP. Keep shared platform auth requests canonical and map extension-only no-cache PoP parameters at the extension transport boundary.

Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Map DPoP binding request and response fields through the platform authentication DOM contract.

Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: edf273d3-ad5a-479e-8062-7c7ee8b1db37
@hectormmg
Hector Morales (hectormmg) force-pushed the copilot/ab-3715427-wam-dpop-contract-types branch from 20e4b35 to 99f5786 Compare August 25, 2026 21:51
Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78f9666b-ef4d-4799-bc77-e060b95c5158
Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78f9666b-ef4d-4799-bc77-e060b95c5158
Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78f9666b-ef4d-4799-bc77-e060b95c5158
Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Developer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 78f9666b-ef4d-4799-bc77-e060b95c5158
Co-authored-by: Forge <forge-bot@entra.github.io>
Forge-Agent: Coder
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9aeede78-98ca-464d-bc07-6eb95602bb3a
Preserve legacy PoP key ownership in platform cache requests, avoid coalescing concurrent DPoP proofs, and harden L1/L3 lifecycle coverage.

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

Copilot-Session: 9aeede78-98ca-464d-bc07-6eb95602bb3a
Resolve the browser compatibility map conflict by retaining both DPoP key-persistence and legacy polling guidance.

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

Copilot-Session: 9aeede78-98ca-464d-bc07-6eb95602bb3a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9aeede78-98ca-464d-bc07-6eb95602bb3a
@hectormmg

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).

@hectormmg

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).

@hectormmg
Hector Morales (hectormmg) merged commit fd18de7 into dev Nov 4, 2026
85 checks passed
@hectormmg
Hector Morales (hectormmg) deleted the copilot/ab-3715428-wam-dpop-outcome-handling branch November 4, 2026 23:17
Hector Morales (hectormmg) added a commit that referenced this pull request Nov 20, 2026
…hentication DOM API (#8968)

## Summary

Implements AB#3788751 - L3-WI-2F Implement DPoP outcome handling for
Platform Authentication DOM API.

Enable DOM transport support for the broker DPoP handling introduced in
#8789, including the resource-nonce support from #8981.

- Use normal DOM transport discovery and the existing shared L1/L3
validation and key/cache lifecycle. The shared interaction-client
implementation is unchanged from `dev`.
- Pass `properties.token_type`, `properties.DPoP`, and
`properties.binding_attested` unchanged to shared processing, rather
than creating top-level aliases or parsing attestation in the DOM
handler.
- L3 returns the broker proof unchanged, without local signing or
access-token/proof caching. L1 retains MSAL-owned keys and local
resource-proof generation.
- Preserve existing DOM error mapping, broker descriptions, exceptions,
Bearer/legacy-PoP behavior, and resource-nonce forwarding. Never
serialize internal `bindingPreferenceSent` state.

## Validation

- 336 focused tests passed across the DOM handler, provider, extension
handler, silent-request helpers, and shared interaction client.
- Built `msal-common` before `msal-browser`; browser build passed.
- Lint passed with three existing warnings. Formatting, API Extractor
(`--local`), Beachball, documentation links, and `git diff --check`
passed.
- Coverage includes extension/DOM L1/L3 equivalence,
popup/silent/redirect flows, malformed canonical outcomes, key
ownership, cache replacement, disabled access-token caching, and
consistent error/exception handling across schemes.

## Managed-device validation

VM-validated the DOM L3 DPoP flow using the rebuilt sample from
`86cfcfb25`, including the review cleanups. Seven scenarios passed: L3
acquisition, redirect, repeated broker requests without MSAL
access-token caching, concurrent distinct proofs, Graph nonce
challenge/retry (HTTP 200), wrong-method rejection (HTTP 401), and
app-provided key rejection.

The subsequent `89528a60e` change only restores the existing opt-in
serialization-error diagnostic and its unit-test assertion; local
validation passed. The external sample is not part of this PR.

```text
<!-- BEGIN pr-telemetry -->
assistance: agentic-cli
type: feature
agent-tool: copilot-cli
agent-model: gpt-6.1-sol
work-item: AB#3788751
<!-- END pr-telemetry -->
```

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d23898df-9767-4bfd-85c8-8b156caa2619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic-cli Copilot CLI / terminal agent drove the bulk of the edits feature Feature requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants