Closed
Description
- Gitea version (or commit ref): 1.4.1
- Git version: 2.17.0
- Operating system: FreeBSD
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- [X ] Not relevant
- Log gist:
Failed to login 'user@domain.com' via 'ldap2.domain.local': Invalid pattern for attribute 'username' [user@domain.com]: must be valid alpha or numeric or dash(-_) or dot characters
Description
Users in my ldap directory only have a full email address as their "uid" and therefore their username (for several reasons). I cannot get gitea to function in such an environment, because of the following check in login_source.go:
if binding.AlphaDashDotPattern.MatchString(sr.Username) {
return nil, fmt.Errorf("Invalid pattern for attribute 'username' [%s]: must be valid alpha or numeric or dash(-_) or dot characters", sr.Username)
}
It would be wonderful if the check allowed for "@" characters as well.
Thank you!
...