LDAP Fails on First Login with Sign-up disabled
Summary
When a user first signs into GitLab using LDAP authentication and Sign-Up is disabled in admin settings, then GitLab will redirect to an empty-response 403 page after successful login.
Steps to reproduce
- Configure gitlab to use LDAP authentication
- Disable sign-up in admin settings
- Using a LDAP user who has never logged into GitLab before, try to login using correct credentials.
What is the current bug behavior?
The browser redirects to a path "/users/auth/ldapmain/callback". The URL returns an empty response with a 403 HTTP response code. The user is not logged in.
What is the expected correct behavior?
The user should be sent to the GitLab dashboard since they have logged in.
Relevant logs and/or screenshots
There is no message in the log which indicates failure other than the fact that rails sent back a "403" response.
Output of checks
Results of GitLab environment info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Redis Version: 3.2.5
Git Version: 2.11.1
Sidekiq Version:4.2.7
GitLab information
Version: 9.1.0
Revision: c3f0f14
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://git.buyme360.com
HTTP Clone URL: https://git.buyme360.com/some-group/some-project.git
SSH Clone URL: git@git.buyme360.com:some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 5.0.2
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 5.0.2 ? ... OK (5.0.2)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... can't check, you have no projects
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
DN: uid=beald,ou=Users,dc=buyme360,dc=com uid: beald
DN: uid=ortizo,ou=Users,dc=buyme360,dc=com uid: ortizo
(... there are a bunch more entries here ...)
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... can't check, you have no projects
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.11.1)
Active users: 3
Checking GitLab ... Finished
Possible fixes
IDK :)