You are using Authentication and authorization in Azure App Service .
App Service passes user claims to your application by using special headers. External requests aren't allowed to set these headers, so they are present only if set by App Service. Some example headers include:
- X-MS-CLIENT-PRINCIPAL-NAME
- X-MS-CLIENT-PRINCIPAL-ID
- X-MS-TOKEN-AAD-ID-TOKEN
- X-MS-TOKEN-AAD-ACCESS-TOKEN
reference : https://learn.microsoft.com/en-us/azure/app-service/app-service-authentication-how-to#access-user-claims
Code that is written in any language or framework can get the information that it needs from these headers. For ASP.NET 4.6 apps, the ClaimsPrincipal is automatically set with the appropriate values.
Your application can also obtain additional details on the authenticated user by calling /.auth/me.
But currently seems ASP.NET Core does not support flowing identity info from an IIS module (like Easy Auth) to the app code . See discussion here .
I haven't test that in current days . But you can always get user's name , token information from above headers . If you want to get more user's claims , you can make a server-side request to the in-build endpoint /.auth/me
to retrieve the claims .
You can write custom middlerware to populate the User property in .net Core :
https://stackoverflow.com/a/42270669/5751404