[英]Asp.net, Active Directory authentication not working
我无法在自己的网站上使用AD身份验证。 我有以下工作正常的测试代码:
DirectoryEntry entry = new DirectoryEntry(srvr, usr, pwd);
object nativeObject = entry.NativeObject;
在我的网站上,出现错误“您的登录尝试失败。请重试。”。 我确实无法找出阻止登录的潜在错误是什么。
这是我的web.config中的部分:
<authentication mode="Forms">
<forms loginUrl="Default.aspx"
timeout="30"
name=".ADAuthCookie"
path="/"
requireSSL="false"
slidingExpiration="true"
defaultUrl="Edit.aspx"
cookieless="UseCookies"
enableCrossAppRedirects="false"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<membership defaultProvider="MyADMembershipProvider">
<providers>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADAuthConnection"
applicationName="/"
connectionProtection="Secure"
enableSearchMethods="true"
connectionUsername="company\usr"
connectionPassword="pwd"/>
</providers>
</membership>
这不是全部吗? 我不打算使用配置文件,所以我没有配置ProfileProvider,这可能会引起问题吗?
感谢帮助!
你检查了吗
哪个很好地介绍了如何设置和使用AD成员资格提供程序? 但是浏览那篇文章,看来您做的一切正确……
除了我不知道您的AD连接字符串是什么样子-您能告诉我们那条信息吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.