Open pirovorster opened 2 years ago
You can access the ClaimsIdentity collection from the HttpRequestData
instance.
IEnumerable<System.Security.Claims.ClaimsIdentity> identities = req.Identities;
The identities also does not have the identity from the "StaticWebAppsAuthCookie". Currently I con only get it by parsing the cookie myself. Imo it should work like the NON isolated process model.
This article illustrates a work around: https://adamstorr.azurewebsites.net/blog/using-azure-functions-middleware-to-access-claimsprincipal-in-azure-static-web-apps
This seems like a good ask -- we'll assign it for investigation in a future sprint.
I'm currently trying to get the ClaimsPrincipal from my isolated process Azure Function.
Initially I had the same issue as specified here: https://github.com/Azure/azure-functions-dotnet-worker/issues/694.
I upgraded to 1.6 and this fixed my claims being empty. However my ClaimsPrincipal is null.
I have the exact same function with the only difference being that its not a isolated process and the Claims Principal is NOT null. Initially I thought that once the claims got populated that the ClaimsPrincipal will magically work but this was not the case.