Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitea rejects usernames from LDAP which contain ".-" #31475

Open
matrss opened this issue Jun 24, 2024 · 1 comment
Open

Gitea rejects usernames from LDAP which contain ".-" #31475

matrss opened this issue Jun 24, 2024 · 1 comment

Comments

@matrss
Copy link

matrss commented Jun 24, 2024

Description

The central AD instance in our organization provides usernames that contain ".-" for people with e.g. hyphenated first names. This is outside of my control. In the past, Gitea allowed these usernames, but since some point (#20136 I'd guess) this is no longer the case.

Since I am not able to change what is given to me as a username this means that people with these names are currently unable to login for the first time (i.e. when they don't have an account yet).

While there is probably some merit to the enforced rules on usernames, I think there should be an option to overrule those specifically for external authentication sources. Alternatively, there should be some mechanism to convert the provided usernames into something Gitea accepts, automatically.

Gitea Version

v1.20.5 (yes, outdated, working on it)

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker compose

Database

PostgreSQL

@silverwind
Copy link
Member

silverwind commented Jun 24, 2024

We should continue enforce the usernames to be compatible with other forges, but for such auto-generated users from OAuth or LDAP, I could see adding a mechanism that tries to removes invalid characters from the username and if the name is available, use that.

For example if try I create a org foo.-baz on GitHub UI, it would create it as foo-baz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants