This has had me stumped for a while. None of the commonly encountered similar situations seem to apply here apparently. I\'ve probably missed something obvious but I can\'
Using MVC 5
Steps to overcome this issue:-
1. Update your Anonymous attribute of WebAPI project and make it like
[System.Web.Mvc.AllowAnonymous]
Now go to your custom attribute class and write the code
 public override void OnAuthorization(System.Web.Http.Controllers.HttpActionContext filterContext)
{
    if (filterContext == null)
    {
        throw new UnauthorizedAccessException("Access Token Required");
    }
    base.OnAuthorization(filterContext);
    if (filterContext.ActionDescriptor.GetCustomAttributes().Any())
    {
        return;
    }
    if (filterContext.Request.Headers.Authorization != null)
    {
        var response = 
 PTPRestClient.GetRequest(filterContext.Request.Headers.Authorization.ToString(), 
 "api/validate/validate-request");
        if (!response.IsSuccessStatusCode)
        {
            throw new UnauthorizedAccessException();
        }
    }
    else
    {
        throw new UnauthorizedAccessException("Access Token Required");
    }
}