2010-11-23 96 views
1

我有我的配置設置如下圖所示:如何在活動目錄中使用ASP.NET身份驗證?

<configuration> 
    <connectionStrings> 
    <add name="ADConnectionString" connectionString="LDAP://myldap/CN=Users,DC=nevco,DC=local"/> 
    </connectionStrings> 
<system.web> 
<authentication mode="Forms"> 
    <forms name=".ADAuthCookie" timeout="10" loginUrl="Login.aspx" defaultUrl="Default.aspx" /> 
</authentication> 
    <membership defaultProvider="DomainLoginMembershipProvider"> 
     <providers> 
     <clear/> 
     <add name="DomainLoginMembershipProvider" 
      type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
      connectionStringName="ADConnectionString" attributeMapUsername="sAMAccountName" /> 
     </providers> 
    </membership> 
    </system.web> 
</configuration> 

我可以嘗試登錄,但每次說我使用不正確的用戶名/密碼的時間。它看起來像我在上面做錯了什麼?有什麼方法可以讓我找到更多關於爲什麼找不到我的用戶名/密碼的信息?

UPDATE:

我是否需要提供我的會員/供應商部分中的用戶名和密碼?

+1

如果您使用`LDAP:// myldap /` – 2010-11-23 18:25:09

+1

會出現什麼情況`指定的連接字符串不代表有效的LDAP adspath.' – 2010-11-23 21:57:14

回答

1

好吧,我結束了使用LDAP瀏覽器檢查的結構。經過一番周折後,我改變了我的LDAP網址:

LDAP://myldap/DC=nevco,DC=local 

它開始工作。希望這可以幫助別人!

0

爲什麼要讓用戶登錄?

試試這個提供商

<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" /> 

那麼你可以做一些事情,看看他們是否被授權Roles

Roles.IsUserInRole("someGroupInAd") 

你的網站必須是建立與Integrated Windows Authentication在IIS

相關問題