码迷,mamicode.com
首页 > 其他好文 > 详细

AllowAnonymousAttribute Class

时间:2020-07-17 22:19:11      阅读:78      评论:0      收藏:0      [点我收藏+]

标签:href   ext   attr   tar   text   loading   http   getc   oid   

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);
    }
}

 

技术图片

 

AllowAnonymousAttribute Class

标签:href   ext   attr   tar   text   loading   http   getc   oid   

原文地址:https://www.cnblogs.com/chucklu/p/13332625.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!