Git clone denied for username as LDAP email

Hello,

When I try to clone a repository with LDAP user as user@example.com, I get the following response:

$ git clone https://gitlab.example.com/group/project.git
Cloning into 'project'...
Username for 'https://gitlab.example.com': user@example.com
Password for 'https://user@example.com@gitlab.example.com': 
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.example.com/group/project.git/'

There is no problem to clone as user user.

In /etc/gitlab/gitlab.rb exist allow_username_or_email_login: true
The user user@example.com is a Maintainer.

Both web portal sign-in with username or email are without problems.

Is there a way to configure GitLab so that the LDAP user user@example.com can do clone?

GitLab CE 13.0.6 (5aa982e01ea) [Omnibus]
CentOS Linux release 8.1.1911 (Core)

Best regards,
Zdravko

Hi,

this seems to be a problem with escaping the @ within the HTTP basic auth details of the Git CLI client.
Try to URL encode @ as %40.

Username for 'https://gitlab.example.com': user%40example.com

Cheers,
Michael

Hi Michael,

user%40example.com not working too.

Maybe this behavior is issue to be reported?

Best regards,
Zdravko

Hi,

I am undecided which side introduces the problem - the git client which might not parse and send this correctly, or the server receiving it. For what it is worth, at least the server side is something our engineers may debug so please go ahead with creating a new issue, and linking this topic here.

Thanks!
Michael