Take the 2-minute tour ×

I'm checking if this is a sitecore bug, or if I'm missing something obvious.

EDIT FOR CLARIFICATION: The problem I'm having is that I'm trying to set up the configuration settings in the Domains.config file so that Sitecore shouldn't be creating (and/or returning) an anonymous user for a domain set up this way. However, if I use the Domain.GetUsers() function on the domain, I still get the anonymous user returned.

The membership provider is a custom built and connects to LDAP in read only mode.


Using Sitecore 6.4.1 and given the following domain configuration in App_Config/Security/domains.config

<domain name="DOMAINNAME" ensureAnonymousUser="false" anonymousUserName="" everyoneRoleName="" />

and these comments in that domain.config file

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

If I use the following code,

List<Sitecore.Security.Accounts.User> users = new List<Sitecore.Security.Accounts.User>();
var domain = Sitecore.Security.Domains.Domain.GetDomain(DOMAINNAME);

I get the anonymous user included in users list. I assumed from the comments in the domain.config file that I shouldn't get the anonymous user if I set up my domain as above.

Is there something obvious that I'm missing?

share|improve this question
add comment

2 Answers

I think it's more question to membership provider you use. Take a look at Active Directory Module

Maybe this is something that could help you.

share|improve this answer
That's probably part of my issue, I wrote the membership provider as the AD module didn't do what we needed to do for this client. My main issue is that I think sitecore shouldn't be creating (or returning) an anonymous user if the settings in that config file are correct? –  Marko Apr 14 '11 at 23:16
Sitecore has nothing to do with this. There are only wrappers above membership provider. Out of the box standard ASP.Net security is used link. You need to dig there. Or implement you own membership provider. –  horseman Apr 15 '11 at 9:11
as I said in my first comment, I did implement my own membership provider. The link you provided does not discuss anonymous users so I'm still thinking this is a sitecore specific thing, particularly as the domains.config file contains the anonymousUserName and everyoneRoleName settings and the associated comments with those settings. –  Marko Apr 18 '11 at 4:35
add comment

Just a guess as I have not used 6.4 yet or tweaked any of those types of setting before... but I believe Sitecore always comes pre-packaged with the Anonymous user in the membership. By setting ensureAnonymousUser to false you're just telling it not to ensure its there, but its already there by default. Why don't you try this test:

  1. Set ensureAnonymousUser to true then delete [*] the Anonymous user from the user manager.
  2. Log out and back in and see if it's there again. If so then the "ensure" aspect of that worked. So...
  3. Set ensureAnonymousUser to false then do the same thing. Does the user come back?

This is really just a hunch on how it works -- I don't have an environment like that setup right now to play with, but its worth a shot.

[*] - to delete a user form the User Manager, go to Sitecore > Security > User Manager

share|improve this answer
Hi Mark, ensureAnonymousUser is probably extraneous to my point, but I included it because it dealt with anonymous users. Setting that one to true does ensure an anonymous user is created if one doesn't exist in the domain. Sitecore does come with an anonymous user in the sitecore domain, but I am trying to set up a non sitecore domain via a custom read only LDAP membership provider and I don't want an anonymous user to be returned in the GetUsers() function for said non sitecore domain. –  Marko Apr 14 '11 at 5:38
Good to know. You should update the question with that info as its necessary to better understand your problem. Have you looked at docs for the LDAP module? –  Mark Ursino Apr 14 '11 at 14:18
I have edited the question to provide clarification. I am using a custom built LDAP membership provider as the LDAP module was too much and didn't provide me what I needed for this client. –  Marko Apr 14 '11 at 23:24
add comment

Your Answer


