Can't login as user@company.com with ldap authentication enabled #2599

Closed
opened 2025-11-02 04:41:39 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @ghost on GitHub (Dec 1, 2018).

  • Gitea version (or commit ref): v1.6.0
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04.1
  • 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:
xxxx/xx/xx xx:xx:xx [W] Failed to login 'user@company.com' via 'local_ldap': Invalid pattern for attribute 'username' [user@company.com]: must be valid alpha or numeric or dash(-_) or dot characters
xxxx/xx/xx xx:xx:xx [I] Failed authentication attempt for user@company.com from xxx.xxx.xxx.xxx

Description

Additional information:

  • OpenLDAP: 2.4.45
  • Authentication type: LDAP (simple auth)
  • User DN: uid=%s,ou=my_ou,dc=example,dc=com
  • User Filter: (&(objectClass=inetOrgPerson)(uid=%s))

Obviously the "@" character is not in a class of allowed characters for "username". Will it be possible to add the "@" in the next version?

Originally created by @ghost on GitHub (Dec 1, 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): v1.6.0 - Git version: 2.17.1 - Operating system: Ubuntu 18.04.1 - 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 - Log gist: ``` xxxx/xx/xx xx:xx:xx [W] Failed to login 'user@company.com' via 'local_ldap': Invalid pattern for attribute 'username' [user@company.com]: must be valid alpha or numeric or dash(-_) or dot characters xxxx/xx/xx xx:xx:xx [I] Failed authentication attempt for user@company.com from xxx.xxx.xxx.xxx ``` ## Description Additional information: * OpenLDAP: 2.4.45 * Authentication type: LDAP (simple auth) * User DN: uid=%s,ou=my_ou,dc=example,dc=com * User Filter: (&(objectClass=inetOrgPerson)(uid=%s)) Obviously the "@" character is not in a class of allowed characters for "username". Will it be possible to add the "@" in the next version?
GiteaMirror added the type/question label 2025-11-02 04:41:39 -06:00
Author
Owner

@ghost commented on GitHub (Dec 1, 2018):

Sorry, I put the issue in the comment field instead of the description field.

@ghost commented on GitHub (Dec 1, 2018): Sorry, I put the issue in the comment field instead of the description field.
Author
Owner

@lafriks commented on GitHub (Dec 2, 2018):

There was already request to add this but @ can not be added as allowed character as could lead to side effects in other places later on. It would be ok tho to have it replaced or domain part removed for username with additional option

@lafriks commented on GitHub (Dec 2, 2018): There was already request to add this but `@` can not be added as allowed character as could lead to side effects in other places later on. It would be ok tho to have it replaced or domain part removed for username with additional option
Author
Owner

@ghost commented on GitHub (Dec 3, 2018):

I have seen that you can also authenticate via SMTP. For now this is a workaround. Thanks for the quick answer.

@ghost commented on GitHub (Dec 3, 2018): I have seen that you can also authenticate via SMTP. For now this is a workaround. Thanks for the quick answer.
Author
Owner

@techknowlogick commented on GitHub (Dec 4, 2018):

Closing this issue as a workaround is present. If you have any follow up questions please feel free to open a thread on the forum

@techknowlogick commented on GitHub (Dec 4, 2018): Closing this issue as a workaround is present. If you have any follow up questions please feel free to open a thread on the [forum](https://discourse.gitea.io/)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2599