XWiki.XWikiGuest is creating the User instead of the XWiki.Username

Hello,

I was initially having issue with users getting into XWikiAllGroup. I was goggling and found that, setting this config xwiki.authentication.group.allgroupimplicit=1 will consider all users as members of the XWiki.XWikiAllGroup and it worked for me.

But the new users are not being created correctly. In below screenshot

1st row is the user being created after setting xwiki.authentication.group.allgroupimplicit=1 and it is created by XWikiGuest

2nd row is the user before setting xwiki.authentication.group.allgroupimplicit=1 and values before where 0 for allgroupimplict and xwiki.users.initialGroups=XWiki.XWikiAllGroup and the created by was user itself. In this scenario user is not being added to XWikiAllGroup that is the reason I have change the allgroupimplict value.

Why is the 1st row created by XWikiGuest ? Also, 1st row created user is not found in users list when I go to the UI and search.

We are in XWiki 15.10.2 and we use this method to create users context.getWiki().createUser(wikiname, userAttributes, “edit”, context);

image

Hi,

have you used same method for creating the users in both scenario (with and without xwiki.authentication.group.allgroupimplicit set to 1)? To my knowledge there shouldn’t be any impact on the author when using this property, however the way you’re calling #createUser API and in particular the user set in XWikiContext will impact the author of the created user, so you should check that first.

Thanks for your response @surli

I have used the same method while creating users in both scenario.

This is my user set for every new user creation

Map<String, String> userAttributes = new HashMap<>();
userAttributes.put(“first_name”, firstName);
userAttributes.put(“last_name”, lastName);
userAttributes.put(“email”, email);
// Create the User
xWiki.createUser(wikiname, userAttributes, “edit”, context);

I don’t see any issue with createUser method because when I commented out both

#xwiki.users.initialGroups=XWiki.XWikiAllGroup
#xwiki.authentication.group.allgroupimplicit=0

User is being created correctly.