I'm attempting to migrate from a REST API that I developed in a Web App to Azure Functions. In the Web App I use the "Authorize" attribute decoration with a Policy like:
[Authorize(Policy = Permissions.Announcements.Edit)]
[HttpPost]
public IActionResult MyFunction([FromBody] MyDTO dto)
{
/* my code */
}
The code uses JWT tokens for Authentication and ASP.NET Core Identity. My question is there any way to accomplish Policies using Azure Functions v4 in .net 6? Maybe a custom middleware?