Azure Static Web Apps /.auth/me intermittently returns masked userDetails instead of full AAD email

JK-6720 0 Reputation points
2026-09-25T18:30:30.6433333+00:00

I’m using Azure Static Web Apps authentication with Azure AD / Entra ID. Intermittently, /.auth/me returns a masked value in clientPrincipal.userDetails, for example:

{
  "identityProvider": "aad",
  "userId": "11111111111111111111111",
  "userDetails": "joh*****",                      <<<<< Azure SWA masks this for privacy
  "userRoles": ["anonymous", "authenticated"]
}

Other times, for the same signed-in user, it returns the expected full email:

{
  "identityProvider": "aad",
  "userId": "11111111111111111111111",
  "userDetails": "username @domain.com",             <<<<< Azure SWA returns full email address
  "userRoles": ["anonymous", "authenticated"]
}
Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.