Azure B2C custom attributes missing in token on recurring challenges to Azure B2C

Chousein Molla Chousein 1 Reputation point
2022-11-23T22:01:56.88+00:00

I use Azure AD B2C custom policy to enrich the Id token.
All works perfectly when signing in for the first time with my credentials and the custom attributes are returned in the Id token.
When the Id token expires and I challenge again and since the session on Azure B2C is still active I get back another Id token without being redirected to the sign in screen, but this time without the custom attributes in the token.

Web app with Owin OpenIdConnectAuthentication

I would really appreciate if abyone could point me to a direction.

@AmanpreetSingh-MSFT thanks to your posts here I've learned so much. Can you please help me with this?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
3,244 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 30,291 Reputation points Microsoft Employee Moderator
    2022-11-28T04:50:07.13+00:00

    Hi @Chousein Molla Chousein ,

    Thanks for reaching out and apologies for delay in response.

    Glad you are able to resolve the issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.

    264497-image.png

    Thanks,
    Shweta

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.