azure-ad-b2c / unit-tests

Azure AD B2C custom policies unit tests
33 stars 16 forks source link

How to properly read from JSON data into AD B2C custom policy claims #13

Open mmeier-a opened 1 year ago

mmeier-a commented 1 year ago

I have a cartain issue regarding mapping from a JSON response into custom policy claims. I have been through many documentation and examples regarding JSON transformation and extracting claims from JSON, but could not find any hint on my specific JSON format. I am thankful for any solutions and hints, as I really don't know how to access the data within the JSON properly.

The JSON to extract claims from looks like this: [{"account_id":"0925", "first_name":"TestFirst", "last_name":"TestLast", "mail":"testfirst.testlast@mail.com"}]

The only thing I want to achieve is to extract "account_id", "first_name", "last_name" and "mail" into claims to show them in the JWt issuer, like you have already provided similar approaches to other JSON extraction examples in your unit tests.

I really appreciate any guidance on this topic