2

I am following this article to setup an Azure App Service Authentication for my web app that is hosted on Azure. Right now I'm just using a plain MVC template with no authentication setup on the app side. https://learn.microsoft.com/en-us/azure/app-service/app-service-authentication-overview

I've set up Azure to do Google authentication and its prompting for user login correctly. Once authenticated, the user sees the home page. All good so far.

My question is - how I can get the user information at this point? The article states that Azure will automatically update the ClaimsPrincipal but I dont see this happening. This is showing up as null. The only way I can get the user information seems to be in the incoming request headers. There i see items like:

X-MS-CLIENT-PRINCIPAL-NAME      xxxx@gmail.com
X-MS-CLIENT-PRINCIPAL-ID        xxxxx
X-MS-CLIENT-PRINCIPAL-IDP       google
X-MS-TOKEN-GOOGLE-ACCESS-TOKEN  xxxxxx
X-MS-TOKEN-GOOGLE-EXPIRES-ON    2017-02-20T18:50:26.4956245Z
X-MS-TOKEN-GOOGLE-ID-TOKEN      xxxxxxx
MS-ASPNETCORE-TOKEN             xxxxx

Is this the only way for my app to be able to get the user information?

Chris Gillum
  • 14,526
  • 5
  • 48
  • 61
John Lee
  • 1,357
  • 1
  • 13
  • 26

0 Answers0