Skip to content
Discussion options

You must be logged in to vote

I will answer my own question for future reference for others.

The authentication is stored in a cookie that persists across browser sessions.

You can access JSON data about the logged in user at /.auth/me:

{
  "clientPrincipal": {
    "identityProvider": "aad",
    "userId": "xxxxxxxxxxxxxxx",
    "userDetails": "user@domain.com",
    "userRoles": [
      "anonymous",
      "authenticated"
    ]
  }
}

How and when you use that information will vary based on your front end. This article uses it for Blazor WebAssembly:

Authenticate Blazor WebAssembly with Azure Static Web Apps

Here is a link to the code that reads that data and authenticates the user:

https://github.com/anthonychu/blazor…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zola-25
Comment options

Answer selected by scottkuhl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants