在 ASP.NET MVC 中混合 Windows 和表单身份验证

发布于 2024-08-12 08:25:19 字数 148 浏览 2 评论 0原文

我目前正在尝试建立一个同时使用 Windows 身份验证和表单身份验证的网站。我正在使用 ASP.NET MVC,并且需要支持 IIS6 和 7。我将如何让已知的 AD 用户进入应用程序(他们的 AD ID 存储在应用程序数据库中的用户记录中)并将其他人引导至标准用户名/密码页面。

I'm currently trying to set up a website that uses both windows authentication and forms authentication. I am using ASP.NET MVC and both IIS6 and 7 need to be supported. How would I go about letting known AD users into the app (their AD id is stored against their user record in the application database) and directing everyone else to a standard username/password page.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沦落红尘 2024-08-19 08:25:19

看来答案是否定的。我们必须设置 2 个站点,一个是具有表单身份验证的主应用程序,另一个是经过 Windows 身份验证的站点,该站点使用令牌重定向到表单站点,该令牌很快就会过期,告诉表单站点有一个经过身份验证的用户正在传入。

It seems the answer is no. We've had to set up 2 sites, the main application with forms authentication and a separate windows authenticated site which redirects to the forms site with a token which expires quickly telling the forms site that an authenticated user is incomming.

反差帅 2024-08-19 08:25:19

What about the option using custom 401 redirect at IIS level outlined in this article

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文