We're trying to evaluate EpiServer and, we are trying to get Active Directory integration up and running. I can get authenticated, and have specified an AD group to allow access to the dashboard/admin areas. However, whenever I try to search for a group to set up rights for our website, I get an error.
An invalid dn syntax has been specified.
I have installed EPIServer 9 in a development environment. I have tried adjusting with clear LDAP insted of secure, changing the attributeMapUsername, among other things.
Sadly, it appears several people have blogged about this very problem (for example http://world.episerver.com/blogs/Leif-Bostrom/Dates/2010/7/Exposing-the-root-cause-of-ActiveDirectoryRoleProvider-errors/ ), however each references another now defunct blog instead of actually posting the info. If anyone remembers the secret this old blog article revealed, that may help. The blog I linked appears to think it is related to items in our domain with special characters, but I cannot control that and have no way to identify them if that is the case.
Relevent portions of web.config with account names, password, domain names replaced.
<providers>
<clear />
<add name="MultiplexingMembershipProvider" type="EPiServer.Security.MultiplexingMembershipProvider, EPiServer.Framework" provider1="SqlServerMembershipProvider" provider2="ActiveDirectoryMembershipProvider" />
<add name="SqlServerMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="EPiServerDB" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
<add name="ActiveDirectoryMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ActiveDirectoryProviderConnection"
connectionProtection="Secure"
connectionUsername="domain\account"
connectionPassword="password"
enableSearchMethods="true"
attributeMapUsername="sAMAccountName" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="MultiplexingRoleProvider" cacheRolesInCookie="true">
<providers>
<clear />
<add name="MultiplexingRoleProvider" type="EPiServer.Security.MultiplexingRoleProvider, EPiServer.Framework" provider1="SqlServerRoleProvider" provider2="ActiveDirectoryRoleProvider" providerMap1="SqlServermembershipProvider" providerMap2="ActiveDirectoryMembershipProvider" />
<add name="SqlServerRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="EPiServerDB" applicationName="/" />
<add name="ActiveDirectoryRoleProvider"
type="EPiServer.Security.ActiveDirectoryRoleProvider, EPiServer"
connectionStringName="ActiveDirectoryProviderConnection"
connectionProtection="Secure"
connectionUsername="domain\account"
connectionPassword="password"
attributeMapUsername="sAMAccountName" />
</providers>
</roleManager>
<connectionStrings>
<add name="EPiServerDB" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|EPiServerDB_b87605f4.mdf;Initial Catalog=EPiServerDB_b87605f4;Connection Timeout=60;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
<add name="ActiveDirectoryProviderConnection" connectionString="LDAP://domain" />
</connectionStrings>
COMPLETE ERROR
Server Error in '/' Application.
An invalid dn syntax has been specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.DirectoryServices.DirectoryServicesCOMException: An invalid dn syntax has been specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[DirectoryServicesCOMException (0x80072032): An invalid dn syntax has been specified. ] System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +576737 System.DirectoryServices.DirectoryEntry.Bind() +45 System.DirectoryServices.DirectoryEntry.get_AdsObject() +40 System.DirectoryServices.PropertyCollection.Contains(String propertyName) +26 EPiServer.Security.AdsiDataFactory.CreateDirectoryDataFromDirectoryEntry(DirectoryEntry entry) +189 EPiServer.Security.AdsiDataFactory.GetEntry(String distinguishedName) +173 EPiServer.Security.ActiveDirectoryRoleProvider.GetAllRoles() +224 EPiServer.Security.MultiplexingRoleProvider.GetAllRoles() +163 EPiServer.Security.MembershipSecurityEntityProvider.SearchRoles(String partOfName, Int32 startIndex, Int32 maxRows, Int32& totalCount) +184 EPiServer.Security.MembershipSecurityEntityProvider.Search(String partOfValue, String claimType) +41 EPiServer.UI.Edit.MembershipBrowser.SearchRolesByName(String query) +143 EPiServer.UI.Edit.MembershipBrowser.PopulateGroupsUserList(String name, String email) +160 EPiServer.UI.Edit.MembershipBrowser.OnLoad(EventArgs e) +232 System.Web.UI.Control.LoadRecursive() +68 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4498 |