AllowAnonymousAttribute Class

AllowAnonymousAttribute Class

// System.Web.Http.AuthorizeAttribute
// Token: 0x0600010A RID: 266 RVA: 0x000048D5 File Offset: 0x00002AD5
private static bool SkipAuthorization(HttpActionContext actionContext)
{
    return actionContext.ActionDescriptor.GetCustomAttributes<AllowAnonymousAttribute>().Any<AllowAnonymousAttribute>() || actionContext.ControllerContext.ControllerDescriptor.GetCustomAttributes<AllowAnonymousAttribute>().Any<AllowAnonymousAttribute>();
}

 

// System.Web.Http.AuthorizeAttribute
// Token: 0x06000108 RID: 264 RVA: 0x0000487C File Offset: 0x00002A7C
public override void OnAuthorization(HttpActionContext actionContext)
{
    if (actionContext == null)
    {
        throw Error.ArgumentNull("actionContext");
    }
    if (AuthorizeAttribute.SkipAuthorization(actionContext))
    {
        return;
    }
    if (!this.IsAuthorized(actionContext))
    {
        this.HandleUnauthorizedRequest(actionContext);
    }
}

 

 

posted @ 2020-07-17 20:12  ChuckLu  阅读(458)  评论(0编辑  收藏  举报