HttpContext.SkipAuthorization 属性

定义

获取或设置一个值,该值指定 UrlAuthorizationModule 对象是否应跳过对当前请求的授权检查。Gets or sets a value that specifies whether the UrlAuthorizationModule object should skip the authorization check for the current request.

public:
 property bool SkipAuthorization { bool get(); void set(bool value); };
public bool SkipAuthorization { get; set; }
member this.SkipAuthorization : bool with get, set
Public Property SkipAuthorization As Boolean

属性值

如果 UrlAuthorizationModule 应跳过授权检查,则为 true;否则为 falsetrue if UrlAuthorizationModule should skip the authorization check; otherwise, false. 默认值为 falseThe default is false.

注解

SkipAuthorization 属性旨在供需要重定向到允许匿名连接的页面的身份验证模块高级使用。The SkipAuthorization property is intended for advanced use by authentication modules that need to redirect to a page that allows anonymous connections. Forms 身份验证模块和 Passport 身份验证模块都在重定向到已配置的登录页时 SkipAuthorization 设置。The Forms authentication module and Passport authentication module both set SkipAuthorization when redirecting to a configured logon page. 设置 SkipAuthorization 要求设置 ControlPrincipal 标志。Setting SkipAuthorization requires the ControlPrincipal flag to be set. 有关 ControlPrincipal 标志的信息,请参阅 SecurityPermissionFlagFor information about the ControlPrincipal flag, see SecurityPermissionFlag.

适用于