I am trying to write my own authorization attribute, where I run some custom checks of any web api method with the CustomAuthorization attribute.
My code is as follows:
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] public class CustomAuthorization : AuthorizationFilterAttribute { public override void OnAuthorization(AuthorizationContext context) {
The problem I am facing is that I get a 404 response from the web api instead of the expected 401. What am I doing wrong?
This is the core of asp.net 1.
Thanks in advance!
source share