Skip to content

[Bug] WithClientClaims doesn't work with nested JSON objects #5595

@bgavrilMS

Description

@bgavrilMS

Library version used

4.79.0

.NET version

WithClientClaims works with simple custom assertion claims, but not complex ones. We need to ensure that CX can inject a claim like the custom_claims below

{
  "alg": "RS256",
  "x5t": "wHXXbOc3MX66g1j_e_YpH_YdMuo",
}.{
  "aud": "https://login.windows-ppe.net/f435658b-a8c3-4460-adf2-84617caef396/oauth2/token",
  "iss": "6d8ae3e0-2647-41ce-a5f4-0758f10c74a9",
  "sub": "6d8ae3e0-2647-41ce-a5f4-0758f10c74a9",
  "jti": "2DC43547-236D-4199-B7B9-85CF1B4F3D84",
  "exp": 1763585509,
  "nbf": 1763584909,
  "custom_claims": {
    "xms_foo": [
      "abc",
      "def"
    ],
    "xms_az_foo": "bar"
  }
}.[Signature]

Scenario

ConfidentialClient - service to service (AcquireTokenForClient)

Is this a new or an existing app?

This is a new app or experiment

Issue description and reproduction steps

.

Relevant code snippets

Expected behavior

No response

Identity provider

Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)

Regression

No response

Solution and workarounds

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions