Skip to content

docs: WithClientClaims API design for NSP claims support#5982

Open
Robbie-Microsoft wants to merge 5 commits into
mainfrom
rginsburg/05_06_25
Open

docs: WithClientClaims API design for NSP claims support#5982
Robbie-Microsoft wants to merge 5 commits into
mainfrom
rginsburg/05_06_25

Conversation

@Robbie-Microsoft
Copy link
Copy Markdown
Contributor

@Robbie-Microsoft Robbie-Microsoft commented May 6, 2026

Summary

Design doc for WithClaimsFromClient(string claimsJson) — a new per-request MSAL API that lets clients forward a JSON claims payload (e.g., NSP xms_az_nwperimid) to ESTS / IMDS. POC implementation in #5999.

Latest update

  • Renamed WithClientClaimsWithClaimsFromClient throughout, per Bogdan's suggestion. This avoids any clash with the obsolete ConfidentialClientApplicationBuilder.WithClientClaims(X509Certificate2, ...) overload. The historical reference to that obsolete API is preserved in the Naming Note for context.
  • Documented the no-normalization decision in Key Behaviors and in the Resolved Questions table. MSAL does not parse, sort, or normalize the claims JSON. The raw string is stored verbatim and used as part of the cache key. Apps must pass a consistent string. "We will not penalize the 99% who already do that for the cost of normalizing for the 1% who would not."

Resolved questions (now in the doc)

  1. API name → WithClaimsFromClient
  2. CCA: claims go in the ESTS request body, not the client assertion JWT
  3. MSIv1: claims query parameter, percent-encoded
  4. Rollout: MSIv1 first; MSIv2 + CCA follow once MSIv2 design is finalized
  5. JSON normalization → not done by MSAL; caller's responsibility

ETAs (per Nidhi)

Flow Owner Status ETA
CCA / FIC Robbie Done — POC in #5999
MSIv1 Raghu In progress Canary by end of June / mid-July
MSIv2 TBD Blocked on IMDS team design Q2/Q3

E2E testing

Open question — Nidhi confirming test environment availability with Redis Cache team. Likely requires a test VM with MSI inside an NSP; CCA path testable in existing MSAL test tenant.

Related

Captures the proposed approach for supporting client-originated claims
(NSP/Network Security Perimeter) across MSIv1, MSIv2, cert-based, and
FIC auth flows. Documents the current state of each flow, the gap in
the existing WithClaims() API, and the design for a new
WithClientClaims() API with proper cache keying.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/nsp_claims_design.md Outdated
Comment thread docs/nsp_claims_design.md
- Clarify that the new WithClientClaims(string) request-level API coexists
  without conflict with the existing obsolete app-level WithClientClaims
  (X509Certificate2, IDictionary) — different classes, different signatures
- Add NSP SDK call-site code snippet showing claims sourced at request time,
  making the request-level design concrete and demonstrating why app-level
  placement would not support dynamic enforcement-mode changes
- Add explanation of why per-request placement is correct: enforcement mode
  changes produce new claims; request-level avoids needing to recreate the app

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Robbie-Microsoft and others added 2 commits May 22, 2026 13:39
…pe restriction, and MSIv1 claim allowlist

- Clarify CCA transport: WithClientClaims sends claims as ESTS request body parameter,
  NOT embedded in the client assertion JWT. This resolves Bogdan's concern.
- Add Scope section: MIRP-gated, Redis Cache only, delegated identities only initially.
- Add MSIv1 claim restriction: only xms_az_nwperimid is accepted; MSAL validates upfront
  to avoid opaque HTTP 400 from IMDS.
- Add ETAs table: CCA done; MSIv1 (Raghu) canary by June 30; MSIv2 blocked on IMDS design.
- Add E2E testing plan: Redis Cache team's help needed for MSI; existing test tenant for CCA.
- Move resolved questions from Open Questions to a Resolved Questions table.
- Update remaining open questions to only the two still unresolved items.
- Add link to POC implementation PR #5999.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/nsp_claims_design.md Outdated
Comment thread docs/nsp_claims_design.md
…cision

Addresses Bogdan's feedback on PR #5982 + #5999:

- Rename the proposed API throughout from `WithClientClaims` to
  `WithClaimsFromClient` (Bogdan's suggestion). The historical reference to
  the unrelated obsolete `ConfidentialClientApplicationBuilder.WithClientClaims(X509Certificate2, ...)`
  overload is left intact in the Naming Note for clarity.
- Document the no-normalization design decision in Key Behaviors and add it to
  the Resolved Questions table. MSAL uses the raw claims string verbatim as
  part of the cache key. The application is responsible for passing a
  consistent string. Quote: "We will not penalize the 99% who already do that
  for the cost of normalizing for the 1% who would not."

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

5 participants