Authentication Sign-In Name is not used when switching authentication sources #5114

Open
opened 2025-11-02 06:14:54 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @sh4nks on GitHub (Mar 25, 2020).

  • Gitea version (or commit ref): 1.11.3
  • Git version: 2.22.2
  • Operating system: RHEL 7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2020/03/25 13:06:24 ...dels/login_source.go:804:UserSignIn() [W] Failed to login 'MY_SECRET_LDAP_UID' via 'LDAP': e-mail already in use [email: my@email.address]
2020/03/25 13:06:24 ...s/context/context.go:139:HTML() [D] Template: user/auth/signin
2020/03/25 13:06:24 routers/user/auth.go:171:SignInPost() [I] Failed authentication attempt for MY_SECRET_LDAP_UID from xx.xx.xx.xx

Description

The problem is following:

I have used as of now only the local/standard login method for authenticating users. However, we need to use LDAP now.
So I have configured the LDAP Authentication Source (simpleauth) and everything works IF the user/email does not exist.
However, when I switch an existing user from Local to LDAP and fill in the Authentication Sign-In Name and try to login again, it doesn't work (see Log gist above) due to the email already being in use.

Now, I am not entirely sure if this is a bug or if the LDAP Authentication source is simply not configured to use the Authentication Sign-In Name?

Edit 28.10.2020:
Short update on my site - I figured that I can login when using the old username, however I can't login when using the one for LDAP. Would be cool if we could either merge these two settings (as has been proposed in the comments) or clarify this a bit more.

Screenshots

image

Originally created by @sh4nks on GitHub (Mar 25, 2020). <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.11.3 - Git version: 2.22.2 - Operating system: RHEL 7 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ``` 2020/03/25 13:06:24 ...dels/login_source.go:804:UserSignIn() [W] Failed to login 'MY_SECRET_LDAP_UID' via 'LDAP': e-mail already in use [email: my@email.address] 2020/03/25 13:06:24 ...s/context/context.go:139:HTML() [D] Template: user/auth/signin 2020/03/25 13:06:24 routers/user/auth.go:171:SignInPost() [I] Failed authentication attempt for MY_SECRET_LDAP_UID from xx.xx.xx.xx ``` ## Description The problem is following: I have used as of now only the local/standard login method for authenticating users. However, we need to use LDAP now. So I have configured the LDAP Authentication Source (simpleauth) and everything works **IF** the user/email **does not** exist. However, when I switch an existing user from ``Local`` to ``LDAP`` and fill in the ``Authentication Sign-In Name`` and try to login again, it doesn't work (see *Log gist* above) due to the email already being in use. Now, I am not entirely sure if this is a bug or if the LDAP Authentication source is simply not configured to use the ``Authentication Sign-In Name``? Edit 28.10.2020: Short update on my site - I figured that I can login when using the old username, however I can't login when using the one for LDAP. Would be cool if we could either merge these two settings (as has been proposed in the comments) or clarify this a bit more. ## Screenshots ![image](https://user-images.githubusercontent.com/1510708/77535475-f30dac80-6e9a-11ea-946a-74813bce48f2.png)
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 06:14:54 -06:00
Author
Owner

@lafriks commented on GitHub (Mar 25, 2020):

Yeah we should probably add option to merge users from different auth sources

@lafriks commented on GitHub (Mar 25, 2020): Yeah we should probably add option to merge users from different auth sources
Author
Owner

@stale[bot] commented on GitHub (May 24, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (May 24, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@lcnittl commented on GitHub (Oct 28, 2020):

+1 for the merge option

Any way to achieve this in the database for now?

PS: Seen that for my purpose it works. Can change auth source of user and then log in with LDAP credentials without problem.

@lcnittl commented on GitHub (Oct 28, 2020): +1 for the merge option Any way to achieve this in the database for now? PS: Seen that for my purpose it works. Can change auth source of user and then log in with LDAP credentials without problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5114