【问题标题】:How to restrict controller/view access based on domain ad group如何根据域广告组限制控制器/视图访问
【发布时间】:2017-06-07 03:40:33
【问题描述】:

我想将我的网络应用程序的某些部分限制为位于我们域内 AD 组中的某些用户组。

我正在使用 .Net Core 1.1。我也尝试使用 [Authorize] 属性装饰我的控制器,但收效甚微。

.Net Core 目前有办法做到这一点吗?

【问题讨论】:

    标签: asp.net-core asp.net-core-mvc .net-core


    【解决方案1】:

    确保您在 Services 中传递 Windows 身份验证令牌:

    services.Configure<IISOptions>(options =>
                {
                    options.ForwardWindowsAuthentication = true;
                });
    

    然后使用[Authorize]属性如下 [Authorize(Roles = "AD Role")]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多