Improve logging around user generation #1891

Closed
opened 2025-11-02 04:17:00 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @DennisRippinger on GitHub (Jun 7, 2018).

  • Gitea version (or commit ref): 1.4.2
  • Git version: 2.15.2
  • Operating system: alpine
  • 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:
2018/06/07 17:24:10 [T] LDAP will use BindDN.
2018/06/07 17:24:10 [T] Search for LDAP user: dennis
2018/06/07 17:24:10 [T] Bound as BindDN svc_ldap_gitea@somecompany.com
2018/06/07 17:24:10 [T] Searching for DN using filter (sAMAccountName=dennis) and base DC=somecompany,DC=myCompany,DC=com
2018/06/07 17:24:11 [T] Fetching attributes 'sAMAccountName', 'givenName', 'sn', 'mail' with filter (sAMAccountName=dennis) and base CN=Dennis Rippinger,OU=some,OU=myCompany systems ag,OU=myCompanygroup users,DC=int,DC=root,DC=myCompany,DC=ag
2018/06/07 17:24:11 [T] Binding with userDN: CN=Dennis Rippinger,OU=some,OU=myCompany systems ag,OU=myCompanygroup users,DC=int,DC=root,DC=myCompany,DC=ag
2018/06/07 17:24:11 [T] Bound successfully with userDN: CN=Dennis Rippinger,OU=some,OU=myCompany systems ag,OU=myCompanygroup users,DC=int,DC=root,DC=myCompany,DC=ag
2018/06/07 17:24:11 [W] Failed to login 'dennis' via 'myCompany-ldap': e-mail has been used [email: dennis.rippinger@myCompany.group]
2018/06/07 17:24:11 [D] Template: user/auth/signin
2018/06/07 17:24:11 [I] Failed authentication attempt for dennis from 10.102.11.126

Description

This is not really a bug, but bothered me no for some time. I configured the LDAP and was getting this log output. Everything is working, but then something failed. Eventually the problem was that I already registered an admin account with my email, which is also the company email I was reading from the LDAP.

In the context of ldap login the error message "e-mail has been used" was understood as usage of that field as technical identifier. Maybe something like "e-mail is already in use" would help future users configuring LDAP.

Originally created by @DennisRippinger on GitHub (Jun 7, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) 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.4.2 - Git version: 2.15.2 - Operating system: alpine - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ``` 2018/06/07 17:24:10 [T] LDAP will use BindDN. 2018/06/07 17:24:10 [T] Search for LDAP user: dennis 2018/06/07 17:24:10 [T] Bound as BindDN svc_ldap_gitea@somecompany.com 2018/06/07 17:24:10 [T] Searching for DN using filter (sAMAccountName=dennis) and base DC=somecompany,DC=myCompany,DC=com 2018/06/07 17:24:11 [T] Fetching attributes 'sAMAccountName', 'givenName', 'sn', 'mail' with filter (sAMAccountName=dennis) and base CN=Dennis Rippinger,OU=some,OU=myCompany systems ag,OU=myCompanygroup users,DC=int,DC=root,DC=myCompany,DC=ag 2018/06/07 17:24:11 [T] Binding with userDN: CN=Dennis Rippinger,OU=some,OU=myCompany systems ag,OU=myCompanygroup users,DC=int,DC=root,DC=myCompany,DC=ag 2018/06/07 17:24:11 [T] Bound successfully with userDN: CN=Dennis Rippinger,OU=some,OU=myCompany systems ag,OU=myCompanygroup users,DC=int,DC=root,DC=myCompany,DC=ag 2018/06/07 17:24:11 [W] Failed to login 'dennis' via 'myCompany-ldap': e-mail has been used [email: dennis.rippinger@myCompany.group] 2018/06/07 17:24:11 [D] Template: user/auth/signin 2018/06/07 17:24:11 [I] Failed authentication attempt for dennis from 10.102.11.126 ``` ## Description This is not really a bug, but bothered me no for some time. I configured the LDAP and was getting this log output. Everything is working, but then something failed. Eventually the problem was that I already registered an admin account with my email, which is also the company email I was reading from the LDAP. In the context of ldap login the error message "e-mail has been used" was understood as usage of that field as technical identifier. Maybe something like "e-mail is already in use" would help future users configuring LDAP.
GiteaMirror added the type/miscellaneous label 2025-11-02 04:17:00 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1891