Use of the $User variable while using Azure AD Authentication


#1

Per the documentation, it appears i can make use of the $User variable for the currently authenticated user while using AzureAD.

The authentication works perfectly fine, but $User is null in all endpoints. I am not supplying any claims information, I just want to be able to use $user.

Am I missing something obvious?


#2

Try using the $ClaimsPrinciapl variable. It should have all your user info.

If you use: `$ClaimsPrincipal.Identity.Name" you should be be able to get the user name. Not sure why the $User variable is null. :frowning:


#3

I think i may have figured it out. I was using -Content instead of -Endpoint. Thanks Adam!