我正在尝试为 sitecore 配置活动目录模块。
我安装了 AD 模块的软件包并验证了 sitecore 中包含的各种文件。
我做了下面的配置来分层
1. Connection string
<add name="ADConnString" connectionString="LDAP://ldapserver.corp.pk.com:389,DC=corp,DC=pk,DC=com" />
2. Membership provider
<membership defaultProvider="sitecore" hashAlgorithmType="SHA1">
<providers>
<clear />
<add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="switcher" providerWildcard="%" raiseEvents="true" />
<add name="sql" type="System.Web.Security.SqlMembershipProvider" connectionStringName="core" applicationName="sitecore" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="256" />
<add name="switcher" type="Sitecore.Security.SwitchingMembershipProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/membership" />
<add name="ad" type="LightLDAP.SitecoreADMembershipProvider" connectionStringName="ADConnString" applicationName="sitecore" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionUsername="****" connectionPassword="****" connectionProtection="Secure" attributeMapUsername="sAMAccountName" enableSearchMethods="true" customfilter="(memberOf=CN=SitecoreUsers,OU=Groups,DC=corp,DC=pk,DC=com)" />
</providers>
</membership>
3. Role provider
<roleManager defaultProvider="sitecore" enabled="true">
<providers>
<clear />
<add name="sitecore" type="Sitecore.Security.SitecoreRoleProvider, Sitecore.Kernel" realProviderName="switcher" raiseEvents="true" />
<add name="sql" type="System.Web.Security.SqlRoleProvider" connectionStringName="core" applicationName="sitecore" />
<add name="switcher" type="Sitecore.Security.SwitchingRoleProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/roleManager" />
<add name="ad" type="LightLDAP.SitecoreADRoleProvider" connectionStringName="ADConnString" applicationName="sitecore" username="ldapuser" password=" ldappw" attributeMapUsername="sAMAccountName" cacheSize="2MB" />
</providers>
</roleManager>
4. Added domain in App_config/Security/Domains.config
<domain name="ad" ensureAnonymousUser="false" />
5. Added swtiching providers for membership and role providers
<switchingProviders>
<membership>
<provider providerName="sql" storeFullNames="true" wildcard="%" domains="*" />
<provider providerName="ad" storeFullNames="false" wildcard="*" domains="ad" />
</membership>
<roleManager>
<provider providerName="sql" storeFullNames="true" wildcard="%" domains="*" ignoredUserDomains="" allowedUserDomains="" />
<provider providerName="ad" storeFullNames="false" wildcard="*" domains="ad" />
</roleManager>
</switchingProviders>
我确实浏览到 ProvidersStatus 页面,我看到活动目录模块正在使用 sitecore 正确设置
当我浏览到 sitecore 桌面 -> 安全工具 -> 用户管理器.. 我没有在列表中看到用户,但在域部分我看到了新域“广告”
当我查看日志时..我看到以下错误
ERROR Active Directory existing checking exception: System.DirectoryServices.DirectoryServicesCOMException (0x8007052E): The user name or password is incorrect.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_NativeObject()
at LightLDAP.MembershipResolver.DirectoryEntryExists(String path, String username, String password, AuthenticationTypes types)
ERROR The AD membership provider couldn't be initialized: The user name or password is incorrect.
Exception: System.DirectoryServices.DirectoryServicesCOMException
Message: The user name or password is incorrect.
我验证了连接到 Active Directory 服务器的用户名和密码,它们似乎是正确的.. 我不知道为什么我根本看不到用户:(
任何帮助表示赞赏。谢谢。