LDAP sync incorrectly assigns user attributes #3656

Closed
opened 2025-11-02 05:20:42 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @polymeter on GitHub (Jul 23, 2019).

  • Gitea version (or commit ref): 1.9.0-rc2 (also reproduced on 1.8.3)
  • Git version: 2.20.1
  • Operating system: Debian 10 (buster)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I have an auth source with LDAP via BindDN configured. When User Sync is enabled and runs, the profile fields are always set to

  • Full name = username
  • Email = username@localhost

for all LDAP users, although proper values are available. This happens for existing users (fields are overwritten) as well as newly created ones.

For new (not yet synced) users, the fields are correctly populated on first login, so the LDAP config seems to be fine.

Originally created by @polymeter on GitHub (Jul 23, 2019). - Gitea version (or commit ref): 1.9.0-rc2 (also reproduced on 1.8.3) - Git version: 2.20.1 - Operating system: Debian 10 (buster) - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description I have an auth source with LDAP via BindDN configured. When User Sync is enabled and runs, the profile fields are always set to * Full name = *username* * Email = *username*@<!-- -->localhost for all LDAP users, although proper values are available. This happens for existing users (fields are overwritten) as well as newly created ones. For new (not yet synced) users, the fields are correctly populated on first login, so the LDAP config seems to be fine.
GiteaMirror added the issue/stale label 2025-11-02 05:20:42 -06:00
Author
Owner

@roycec commented on GitHub (Aug 30, 2019):

I encounter a similar problem (not using user sync). I can once correct the mail domain, but when I try to change something else in the profile, I get the error

e-mail already in use

When I delete the user, in hope to recreate it with a new login, I'm not able to log in at all

2019/08/30 16:14:44 ...dels/login_source.go:707:UserSignIn() [W] Failed to login 'user.name' via 'LDAP': e-mail already in use [email: user.name@ourcompany.de]
2019/08/30 16:14:44 routers/user/auth.go:165:SignInPost() [I] Failed authentication attempt for user.name from 10.xx.xx.xx

Gitea version: 1.9.1
OS version: RHEL 7.6
Database: MySQL

PS: This was a fresh install and in my case this also happens when I log in the first time

@roycec commented on GitHub (Aug 30, 2019): I encounter a similar problem (not using user sync). I can once correct the mail domain, but when I try to change something else in the profile, I get the error > e-mail already in use When I delete the user, in hope to recreate it with a new login, I'm not able to log in at all ``` 2019/08/30 16:14:44 ...dels/login_source.go:707:UserSignIn() [W] Failed to login 'user.name' via 'LDAP': e-mail already in use [email: user.name@ourcompany.de] 2019/08/30 16:14:44 routers/user/auth.go:165:SignInPost() [I] Failed authentication attempt for user.name from 10.xx.xx.xx ``` Gitea version: 1.9.1 OS version: RHEL 7.6 Database: MySQL PS: This was a fresh install and in my case this also happens when I log in the first time
Author
Owner

@roycec commented on GitHub (Aug 30, 2019):

ok, I found an "error" in my side ... the user I created as admin had the same email address than another (LDAP) user. So there was a dupicate mail address already configured. I think this solved my issue.

@roycec commented on GitHub (Aug 30, 2019): ok, I found an "error" in my side ... the user I created as admin had the same email address than another (LDAP) user. So there was a dupicate mail address already configured. I think this solved my issue.
Author
Owner

@lunny commented on GitHub (Sep 15, 2019):

@polymeter could you also check if you have a duplicated email addresses.

@lunny commented on GitHub (Sep 15, 2019): @polymeter could you also check if you have a duplicated email addresses.
Author
Owner

@stale[bot] commented on GitHub (Nov 14, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Nov 14, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Nov 28, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Nov 28, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3656