I want to pass a parameter via the request URL to B2C and then be able to send this out as a claim in the access token. I am guessing I will need to capture this in a claimType. How do I go about this?
Thanks!
You can capture query string parameters using a Claims Resolver.
https://learn.microsoft.com/en-us/azure/active-directory-b2c/claim-resolver-overview#oauth2-key-value-parameters
For example, if you would like to capture the ?bandz=test query string parameter, you could resolve that via the {OAUTH-KV:bandz} claims resolver.
In your <RelyingParty>'s output claims, you could then refer to a claim and the value like this:
<OutputClaim ClaimTypeReferenceId="customClaimId" AlwaysUseDefaultValue="true" DefaultValue="{OAUTH-KV:bandz}" />
You would just need a Claim definition for customClaimId.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With