I have a .net core app that uses JWT Token authentication (via Azure AD) app-wise via the [Authorize]
tag. I would like to be able to call the API from our azure functions and authenticate via a custom header "ApiKey". How can i setup the Authorization such that JWT Token Auth is the main form of authentication but if that fails, check if the custom header is present and if the value matches the apikey value in azure keyvault?
I would like to only need to use the [Authorize]
Attribute. Not something like having to specify the scheme. This is close to what I need but I am having some wierd problems inserting my own middleware and would like to have something that integrates with services.AddAuthentication()