0

I have an Azure Static Web App and App Insights running using the standard set of telemetry code found here: https://github.com/Microsoft/ApplicationInsights-JS#snippet-setup-ignore-if-using-npm-setup

I am wondering how I can get the user details using my AAD-protected website? My website generates authentication information that an individual can access by tacking on /.auth/me to the end of the website URL, which looks like, and I am wondering if this is possibly a way to do it.

{
  "clientPrincipal": {
    "identityProvider": "aad",
    "userId": "xxxx",
    "userDetails": "xxxx",
    "userRoles": [
      "authenticated",
      "anonymous"
    ]
  }
}

In related posts, this thread seems fairly related to my interests but I cannot make much of anything from the discussion: Azure - App Insights - how to track the logged-in Username in Auth Id?

John Stud
  • 1,506
  • 23
  • 46
  • User Id will be available under Application insight - >(Usage) Users - >Click on View More insights- > View user time line -> There you will find user id. However, could you please be more specific with your ask? Are you trying to fetch these details in your static website? – AjayKumarGhose Aug 03 '21 at 15:35

1 Answers1

2

I assume that you want user id details using your AAD-protected website . Here are the steps to know the user ID and details:

Go to Application insight > View Application Insights data. enter image description here

Go to users > Click on View more insights

enter image description here

After scroll down to select as below enter image description here

As Selected Authentication user ID > Click on User Timeline to check the details of USER. enter image description here

For more information Please refer this similar So thread.

UserP
  • 194
  • 13
AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15