@User.Identity,Name returns null in asp.net core 5 Azure AD B2c

Rikudou En Sof 21 Reputation points
2021-07-28T23:27:11.6+00:00

Hello.

So I can log in fine. And can log out fine. But it seems I cannot get logged in user. Like how we use the user manager in local identity. How can I implement this?

the User.Identity.Name returns null!

what do I do please?

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
607 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,140 questions
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.
2,633 questions
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,301 Reputation points
    2021-07-30T07:58:42.623+00:00

    Hi @Rikudou En Sof · Thank you for reaching out.

    Please compare your code with the instructions I have provided here: https://github.com/amanmcse/Document/blob/main/AzureADB2C_AuthApp.md#create-your-aspnet-project

    Feel free to tag me in your reply if you have any question.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Clay Brinlee 6 Reputation points
    2023-12-05T22:15:02.5566667+00:00

    I had to go into Azure and within my B2C setup I went to the signin flow and edited the application claims and checked DisplayName

    0 comments No comments