Environment: AzureFunction v4, Net 7, Isolated Function
is there a Microsoft recommended way of retrieving ClaimsPrincipal from HttpRequestData(https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.functions.worker.http.httprequestdata?view=azure-dotnet) ?
I have found the following two options
- Using mvc package with Azure Function: https://github.com/Azure/azure-functions-host/issues/4212#issuecomment-480378690 . I am talking about this package https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.Abstractions.
- Implementing a custom solution like any of the following: 2.1 https://adamstorr.azurewebsites.net/blog/using-azure-functions-middleware-to-access-claimsprincipal-in-azure-static-web-apps 2.2 Developing Azure functions locally
It looks like using MVC package is the easiest option atm.
However, I don't see a comparison of the two approaches or recommendation what should be used. If you could list disadvantages/advantages of two approaches or provide a link to an article/documentation that looks into this problem that would have been great.