I found an example of getting Claims Principal in C# Azure Function:
public static class SampleFunction
{
[FunctionName("Sample")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "sample")] HttpRequest req,
ILogger log,
ClaimsPrincipal principal) // <=here
{
var roles = principal.Claims.Where(e => e.Type == "roles").Select(e => e.Value);
...
}
}
How do I get the same principal in a NodeJS Azure Function?