我在检查这是否为sitecore错误,或者如果我丢失了明显的东西。具有sitecore域名的匿名用户
编辑澄清:我遇到的问题是,我想在Domains.config文件来设置的配置设置,以便Sitecore的不应创建(和/或返回)匿名用户为此设置的域名。但是,如果我在域上使用Domain.GetUsers()函数,我仍然会返回匿名用户。
成员资格提供程序是一种自定义构建,并以只读模式连接到LDAP。
详细
使用Sitecore的6.4.1和APP_CONFIG /安全性给出以下域配置/ domains.config
<domain name="DOMAINNAME" ensureAnonymousUser="false" anonymousUserName="" everyoneRoleName="" />
,并在domain.config文件这些意见
anonymousUserName: <snip> Set to blank to disable the anonymous user for the domain. Optional
ensureAnonymousUser: Indicates if the domain should ensure that an anonymous user for the domain exists in the Membership database. Optional - default value: false
everyoneRoleName: <snip> Set to blank to disable the everyone role for the domain. Optional - default value: Everyone
如果我使用下面的代码,
List<Sitecore.Security.Accounts.User> users = new List<Sitecore.Security.Accounts.User>();
var domain = Sitecore.Security.Domains.Domain.GetDomain(DOMAINNAME);
users.AddRange(domain.GetUsers().ToArray<Sitecore.Security.Accounts.User>());
我得到包含在用户列表中的匿名用户。我从domain.config文件中的评论中假定,如果我像上面那样设置域,那么我不应该得到匿名用户。
有什么明显的我失踪了吗?
嗨马克,ensureAnonymousUser可能是无关我的观点,但我把它列入,因为它处理匿名用户。将其中一个设置为true可确保在域中不存在匿名用户时创建该用户。Sitecore在sitecore域中有一个匿名用户,但我试图通过自定义的只读LDAP成员资格提供程序设置一个非sitecore域,并且我不希望匿名用户在GetUsers()函数中返回表示非sitecore域名。 – Marko 2011-04-14 05:38:35
很高兴知道。您应该更新与该信息的问题,因为它是更好地了解您的问题的必要条件。你有没有看过[文档为LDAP模块](http://sdn.sitecore.net/Products/LDAP.aspx)? – 2011-04-14 14:18:19
我已编辑该问题以提供澄清。我正在使用一个自定义的LDAP成员资格提供程序,因为LDAP模块太多了,并没有提供给我这个客户需要的东西。 – Marko 2011-04-14 23:24:15