【发布时间】:2013-12-05 04:08:55
【问题描述】:
IIS 配置:
Anonymous Authentication Enabled
ASP.NET Impersonation Enabled
Windows Authentication Enabled
*the rest is disabled
Web.Config:
<add name="ADConn" connectionString="LDAP://192.168.0.21" />
.
.
.
<authentication mode="Windows" />
<authorization>
<allow users="*"/>
<deny users="?" />
</authorization>
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/>
<identity impersonate="true"/>
<membership defaultProvider="ADMembership">
<providers>
<add name="ADMembership"
type="System.Web.Security.ActiveDirectoryMembershipProvider"
connectionStringName="ADConn"
connectionUsername="dominic"
attributeMapUsername="sAMAccountName"
connectionPassword="p@ssw0rd" />
</providers>
</membership>
在我的网络应用程序中:
[Authorize]
public class HomeController : Controller
{
我正在尝试将我的应用程序从表单转换为 Windows 身份验证。使用此配置,页面会通过登录对话框提示我。当我使用我的AD帐户时,我无法登录,但是当我使用我的本地帐户时,我可以访问该页面。为什么?我将如何告诉我的应用程序使用特定的 AD?我的配置正确吗?
重要提示:
- 我的 IIS 和 AD 在不同的机器上,它们不在同一个域中。
- 我的 IIS 和客户端在同一台机器上。
- 我的应用程序使用 AD 进行表单身份验证。
- IIS 版本:6.1
- MVC 版本:4
- AD 操作系统:Windows 2008
- 客户端和 IIS 操作系统:Windows 7
【问题讨论】:
标签: asp.net asp.net-mvc iis active-directory windows-authentication