Azure AD B2C sign in doesn't display user name

Occasional Visitor

Hi, I am implementing Azure AD B2C policy on an .Net 5 based MVC app. Unfornately, it is able to sign in, but not able to display the user name, the attribute "User.Identity.Name" is always null, I added the below code to the startup.cs, still doesn't work, please advise.

 

 

 JwtBearerDefaults.AuthenticationScheme, options =>
            {
                options.TokenValidationParameters.NameClaimType = "name";
            });

 

1 Reply

Hi @sdnd2000,

Thanks for posting your issue here.

However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang