I'm developing web API solution for authorization, we decorated each controller action method with the BasicHttpAuthorizeAttribute
class with inherits from AuthorizeAttribute.
public class BasicHttpAuthorizeAttribute : System.Web.Http.AuthorizeAttribute
For every request, I see OnAuthorization method is called twice. when I check the callstack, all the request is made by same thread/processId. I'm using UnityContainer. I registered by Custom Authorize in WebApiConfig.cs Please let me know the reason for calling twice.
If you register a filter in webapiconfig.cs it will run for every incoming request. If you decorate an action with a filter, it will run for that action. Since you registered the filter and decorated the action, it will run two times.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With