I have a Azure Function developed using Powershell Core 6 and secured by enabling the Azure AD Authentication. If an anonymous request is made by doing a GET through a browser, the user is redirected to Azure AD login first and then redirected to my Azure Function.

Now, in the Powershell function, I need to know which has user logged in which is usually found in the ClaimsPrincipal as indicated here:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp
But the httpRequest.Context.User is null when I access it through powershell. Below is the code in my Function:
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
$body = @{
Context = $Request.Context;
HttpContext = $Request.HTTP.Context;
Request = $Request;
}
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = $body
})
It basically returns everything in an attempt to find the User's Identity
Where can I find the User's Identity?
I don;t want to use these headers because they can easily be manipulated to still make the API work.
$Request.Headers['X-MS-CLIENT-PRINCIPAL-NAME']
$Request.Headers['X-MS-CLIENT-PRINCIPAL-ID']