【问题标题】:Windows-Authentication redirect Page?Windows 身份验证重定向页面?
【发布时间】:2012-11-29 21:28:32
【问题描述】:

我有一个 Windows 身份验证 Intranet 站点。

<authentication mode="Windows"  >
</authentication>
<authorization>
  <deny users="?" />
</authorization>

如果用户在Controller上授权失败,

[Authorize(Roles="Admin")]
public class SearchController : BaseController

我希望他们定向到 ~/UnAuthorized/Index

这可以在 Web.Config 中设置,类似于我可以重定向到登录页面的表单身份验证吗?我只想重定向到我在 (~/UnAuthorized/Index) 处的简单 [AllowAnonymous] 控制器

【问题讨论】:

    标签: asp.net-mvc asp.net-mvc-4 windows-authentication


    【解决方案1】:

    不,这不容易设置。如果用户未针对给定应用程序进行身份验证,则用户代理会提示他提供他的凭据。您无法通过 Windows 身份验证对此对话框的 UI 方面进行太多控制。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-01
      • 2011-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-11
      • 1970-01-01
      • 2022-07-15
      相关资源
      最近更新 更多