# Nextcloud & SSO appearing duplicate accounts for the same user, anyway to map/merge them?

**URL:** <https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700>\
**Category:** ℹ️ Support\
**Created:** [February 12, 2021, 6:40pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700 "2021-02-12T18:40:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeNightmare](https://help.nextcloud.com/letter_avatar/codenightmare/32/5_5575768a8748004e209b776fc1b2916d.png) [@CodeNightmare](https://help.nextcloud.com/u/CodeNightmare)\
**Post date:** [February 12, 2021, 6:40pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/1 "2021-02-12T18:40:25Z")

</div>

Hello guys i have nextcloud set up syncing with ldap and also have SSO enabled via keycoak  
The keycloak server syncs with the very same ldap server nextcloud syncs.

The problem is that upon importing users nextcloud understands them as two different accounts even though they have the same username/email etc .Everything is identical since they are coming from the same ldap database.

E.G  
This user is the same both in nc & keycloack but its understanded as 2 different accounts who has same name,email just the id added from the keycloak.

 ![image](https://user-images.githubusercontent.com/61245954/107820421-6c4c1180-6d83-11eb-9023-e5f2c1ef7a94.png)

How can i marge those accounts , am only asking since rocket.chat does this automatically so it should be possible in here as well but i can’t think how.

---

<div class="post-metadata">

**Author:** ![minecraftchest1](https://help.nextcloud.com/user_avatar/help.nextcloud.com/minecraftchest1/32/34908_2.png) [@minecraftchest1](https://help.nextcloud.com/u/minecraftchest1)\
**Post date:** [February 12, 2021, 6:48pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/2 "2021-02-12T18:48:10Z")

</div>

In the users account, go to `settings > connected accounts` and connect the ldap account to the keeclock account.

---

<div class="post-metadata">

**Author:** ![CodeNightmare](https://help.nextcloud.com/letter_avatar/codenightmare/32/5_5575768a8748004e209b776fc1b2916d.png) [@CodeNightmare](https://help.nextcloud.com/u/CodeNightmare)\
**Post date:** [February 12, 2021, 7:18pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/3 "2021-02-12T19:18:21Z")

</div>

Where is user account located? On keycloac or nc ?  
@minecraftchest1

---

<div class="post-metadata">

**Author:** ![minecraftchest1](https://help.nextcloud.com/user_avatar/help.nextcloud.com/minecraftchest1/32/34908_2.png) [@minecraftchest1](https://help.nextcloud.com/u/minecraftchest1)\
**Post date:** [February 12, 2021, 7:59pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/4 "2021-02-12T19:59:34Z")

</div>

You would link the nc account to keycloac. He would be able to sign in with either. Beyond that, I don’t know what you mean.

---

<div class="post-metadata">

**Author:** ![CodeNightmare](https://help.nextcloud.com/letter_avatar/codenightmare/32/5_5575768a8748004e209b776fc1b2916d.png) [@CodeNightmare](https://help.nextcloud.com/u/CodeNightmare)\
**Post date:** [February 12, 2021, 8:05pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/5 "2021-02-12T20:05:13Z")

</div>

Yea you clearly miss my point i think.

---

<div class="post-metadata">

**Author:** ![V\_Kim](https://help.nextcloud.com/user_avatar/help.nextcloud.com/v_kim/32/37840_2.png) [@V\_Kim](https://help.nextcloud.com/u/V_Kim)\
**Post date:** [May 4, 2021, 8:22am UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/6 "2021-05-04T08:22:04Z")

</div>

Hello! Did you manage to solve this problem?

I have the same problem. Configured ldap authorization using kerberos. User accounts are also duplicated. Please help to solve the problem.

---

<div class="post-metadata">

**Author:** ![ewok2](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ewok2/32/43411_2.png) [@ewok2](https://help.nextcloud.com/u/ewok2)\
**Post date:** [July 28, 2022, 3:19pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/7 "2022-07-28T15:19:42Z")

</div>

Hello  
I have exacly the same problem  
Did you found a way to link account ?  
Thanks

---

<div class="post-metadata">

**Author:** ![ewok2](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ewok2/32/43411_2.png) [@ewok2](https://help.nextcloud.com/u/ewok2)\
**Post date:** [October 9, 2022, 1:23pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/8 "2022-10-09T13:23:45Z")

</div>

Hello  
Some news on this subject

In the “Intergation LDAP/AD” menu from the Admin user, if you go in the “Expert” tab, it is possible to change the UUID used to creat the account by something else like “uid”.

In the “Social Login / Custom OpenID Connect” menu, the “” Internal name" will be used to creat the user by adding " Internal name"-“uid”

But I don’t succed to :

- add a fixed chain befor “uid” in the Expert menu (something like "keycloak-"uid instead of uid)
- creat a social Login without “Internal name”

any idea to have the same identifier with “Intergation LDAP/AD” and “Social Login” ?

The documentation is not so clear [User authentication with LDAP — Nextcloud latest Administration Manual latest documentation](https://docs.nextcloud.com/server/24/admin_manual/configuration_user/user_auth_ldap.html)

thanks

---

<div class="post-metadata">

**Author:** ![ewok2](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ewok2/32/43411_2.png) [@ewok2](https://help.nextcloud.com/u/ewok2)\
**Post date:** [October 9, 2022, 3:51pm UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/9 "2022-10-09T15:51:29Z")

</div>

A work around that “works”…  
In the ldap creat a custom fields “nextcloudUid”  
put inside for each user that have a account in nextcloud “keycloak-uid” with the uid of the current user.  
=\> and in nextcloud / LDAP / expert menu, add in the UUID fiel “nextcloudUid”

and both keycloak and Ldap login goes to the same account…

it is partialy Sloved because you have for each user to set the new fieldd nextcloudUid …

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 6:46am UTC](https://help.nextcloud.com/t/nextcloud-sso-appearing-duplicate-accounts-for-the-same-user-anyway-to-map-merge-them/107700/10 "2024-12-13T06:46:37Z")

</div>


