question

Srivalli-3889 avatar image
0 Votes"
Srivalli-3889 asked ·

How to get id token in ADB2C custom policy

Hi All,

We are trying to capture the id token that gets generated while a custom policy is executed. Is there any way we can assign it to a claim and use it in the custom policy. we could infer from the application insights that id token is present in the ValidationResponse of "login-NonInteractive" technical profile.

Logs:

""ValidationResponse"": {
""ContentType"": ""Json"",
""Created"": ""2019-12-06T07:29:26.216Z"",
""Key"": ""ValidationResponse"",
""Persistent"": true,
""Value"": ""{\""token_type\"":\""Bearer\"",\""scope\"":\""user_impersonation\"",\""expires_in\"":\""3599\"",\""ext_expires_in\"":\""3599\"",\""expires_on\"":\""1575620966\"",\""not_before\"":\""1575617066\"",\""resource\"":\""57caffef-83ff-49af-ba39-4e539cb78494\"",\""access_token\"":\"""",\""refresh_token\"":\"""",\""id_token\"":\""***.\""};1;login-NonInteractive;False""
},

Thank you for checking!

azure-ad-b2c
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

amanpreetsingh-msft avatar image
1 Vote"
amanpreetsingh-msft answered ·

@Srivalli-3889
Azure AD B2C currently supports passing only the access token of External IDPs. ID token issued by B2C can't be added as claim in the token.

Below are the docs for passing the access token of External IDPs as claims using custom policy and built-in user flow:

  1. https://docs.microsoft.com/en-us/azure/active-directory-b2c/idp-pass-through-custom

  2. https://docs.microsoft.com/en-us/azure/active-directory-b2c/idp-pass-through-user-flow


Please "mark as answer" or "vote as helpful" wherever the information provided helps you to help others in the community.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.