Using ldap with existing users in Xwiki (I don't want to create new users but use existing ones)

Hello,
we have been using XWiki with the embedded method to create/manage the users but now we are implementing ldap. I have configured XWiki for ldap and it works. My only issue is that a new user is created at the first connexion, and what I want is that the current XWiki user is used.
For example, a user JDupond already exists in XWiki and when JDupond connects with ldap, a new account JDupond_1 is created instead of connecting with JDupond.
Ldap has been configured to use UID field as account parameter. (UID =JDupond)
How can I solve that ?
Thanks and regards
Catherine

We are using OpenIDConnect and had nearly the same issue except that it had the suffix „0“: WilliamGibson vs. WilliamGibson0.

We fixed it with deleting both. The next login „WilliamGibson“ got the valid (new) account and all articles written / edited by him before where linked to him.

Simpel

Thank you for your answer,
I have started to try this way but when I deleted some users, a lot of things stop working in the wiki (like calendars), so I revert back to the snapshot.
I will try again with your informations and maybe when the users are recreated by ldap and linked with the deleted users, it will solved the issues that appeared in the wiki.
Catherine

You do not need to delete the user at all,

It is enough to take a close look at the users in the object editor.

Log in with the LDAP so that a new user is created,
Then look at its objects,
here an object should be created e.g. this one.
grafik

Look at the values and add the object to the existing user.
Now the login should be able to connect the existing users correctly.

Deleting and renaming/moving users in Xwiki is dangerous especially when it comes to the admin.
That according to my ketnissstand the authorization to run script is not on the page bzeihen but on the user, the wiki dan no longer found.
We just ran into this trap yesterday.

Thank you for the hint,
finally, we didn’t connect with LDAP first but we have directly edited the current users in object mode and add the object in the XWiki.LDAPProfileClass with the correct values and it works well.
Catherine