简体   繁体   English

使用Active Directory成员资格提供程序的ASP.NET登录控件

[英]ASP.NET Login Control with Active Directory Membership Provider

I have setup a basic application which uses the ActiveDirectoryMembershipProvider to talk to our AD and authenticate users. 我已经安装了一个基本应用程序,该应用程序使用ActiveDirectoryMembershipProvider与我们的AD进行对话并验证用户身份。 It's a simple login page with the control which redirects me to a simple output of who is logged in and associated ticket information, this works great and when I test it on my development machine it just works. 这是一个带有控件的简单登录页面,该页面将我重定向到登录者和相关票证信息的简单输出,效果很好,当我在开发机器上对其进行测试时,它就可以正常工作。

However if I deploy this to the webserver under a virtual directory, it simple refuses to direct or even acknowledge that there ticket is a valid ticket, it just refreshes back to the login page. 但是,如果我将其部署到虚拟目录下的Web服务器,它只是简单地拒绝定向甚至承认票证是有效的票证,它只是刷新回到登录页面。 If I type in rubbish credentials it actually recognises this and tells me there';s an error, but if I login successfully it just refreshes the page. 如果我输入垃圾凭证,它实际上会识别出这个错误并告诉我,这是一个错误,但是如果我成功登录,它只会刷新页面。 When I manually go the information page it treats me as an unauthenticated user! 当我手动进入信息页面时,它将我视为未经身份验证的用户!

This is most puzzling! 这是最令人困惑的! Any help would be greatly appreciated! 任何帮助将不胜感激!

Thanks 谢谢

Jon 乔恩

As requested a section of the Web.config 根据要求,Web.config的一部分

<connectionStrings>
  <add name="ActiveDirectory" connectionString="LDAP://x.x.x.117:389/OU=Users,DC=BC,DC=Local"/>
</connectionStrings>

<membership defaultProvider="ADMembershipProvider">
<providers>

<add name="ADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ActiveDirectory" connectionUsername="xxxxxx" connectionPassword="xxxxxxx" attributeMapUsername="sAMAccountName" applicationName="/"/>

</providers>

</membership>

Have you turned on impersonation in the web.config file? 您是否已在web.config文件中启用了模拟功能? I belive there are some issues revolving the membership provider that need impersonation to work properly. 我相信有一些问题困扰着会员提供者,需要模拟才能使其正常工作。

<forms slidingExpiration="true" **path="/Search"** name=".ADAuthCookie" timeout="10"/>

It was also helpful to include a 'path' attribute!!!! 包含“ path”属性也很有帮助!!!!

Jon 乔恩

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM