zoukankan      html  css  js  c++  java
  • 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);
        }
    }

  • 相关阅读:
    go语言学习十七
    go语言学习十六
    go语言学习十五
    go语言学习十四
    go语言学习十三
    go语言学习十二
    go语言学习十一
    go 语言学习十
    go 语言学习九
    go 语言学习八
  • 原文地址:https://www.cnblogs.com/chucklu/p/13332625.html
Copyright © 2011-2022 走看看