Skip to content

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

Open
@matrss

Description

@matrss

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

Activity

silverwind

silverwind commented on Jun 24, 2024

@silverwind
Member

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @silverwind@matrss

        Issue actions

          Gitea rejects usernames from LDAP which contain ".-" · Issue #31475 · go-gitea/gitea