Search code examples
c#azuremicrosoft-entra-idmicrosoft-entra-external-id

How to access User information for Microsoft Entra External ID through code?


I have a basic React Application and .NET 8 Web API with their own App Registrations in an External tenant. I've implemented basic authentication/authorization using MSAL-React and Microsoft.Identity.Web with MS Entra External ID but am struggling to figure out how to query user information (for new user registration events and other things).

I'm used to using the Identity DB tables (AspNetUsers, AspNetUserTokens, etc.) to query for user information but they were already created with Cloud Infra in place at previous employers.

As I'm attempting to go the MS Entra External ID route I'm not sure if I need to utilize MS Graph (never used that) to get this information now or if I'm overthinking this. Any guidance on how to access MS Entra External ID user information in code would be greatly appreciated as I haven't been too successful with finding documentation/articles.


Solution

  • Yes, you can get user attributes via Graph API.

    Most of the equivalent B2C Graph commands work for External ID.

    There are examples and code here.