omniauth-oauth2-generic sending incomplete data to OAuth2 provider
Summary
We’re using Mattermost as our OAuth2 provider to allow for SSO. After upgrading to the latest GitLab version it is no longer possible to successfully authenticate a user using our OAuth2 provider with omniauth-oauth2-generic
.
Steps to reproduce
- Configure GitLab to use a generic OAuth2 provider for SSO according to the documentation
- Click on 'Sign in with' and the configured OAuth2 provider
- Authentication fails
What is the current bug behavior?
After clicking on the button the users web browser successfully makes a request to the OAuth2 provider and is redirected back to GitLab. It is then, that GitLab itself tries to make a POST request to the OAuth2 provider. The request is incomplete though. It is missing at least the client_id
parameter. This is why our OAuth2 provider (Mattermost) denies the request. Attached is a screenshot of the incomplete request and the response from Mattermost.
What is the expected correct behavior?
The correct behavior would be to send a request with all the necessary data for the OAuth2 provider to handle it successfully. We’re using another software which also makes use of our OAuth2 provider and for comparison I’ve attached its request which still functions as expected.
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 10 Current User: git Using RVM: no Ruby Version: 2.7.5p203 Gem Version: 3.1.4 Bundler Version:2.3.15 Rake Version: 13.0.6 Redis Version: 6.2.7 Sidekiq Version:6.4.0 Go Version: unknown GitLab information Version: 15.2.2 Revision: 4ecb014a935 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.10 Using LDAP: no Using Omniauth: yes Omniauth Providers: chat GitLab Shell Version: 14.9.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 14.9.0 ? ... OK (14.9.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Checking Reply by email ...
IMAP server credentials are correct? ... Checking servicedesk yes Mailroom enabled? ... skipped MailRoom running? ... skipped
Checking Reply by email ... Finished
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 2/1 ... yes 12/2 ... yes 7/3 ... yes 7/4 ... yes 7/5 ... yes 7/6 ... yes 8/7 ... yes 8/8 ... yes 8/9 ... yes 12/10 ... yes 10/11 ... yes 10/12 ... yes 12/13 ... yes 12/14 ... yes 12/15 ... yes 7/16 ... yes 8/17 ... yes 7/18 ... yes 7/19 ... yes 12/20 ... yes 12/21 ... yes 12/22 ... yes 12/23 ... yes 12/24 ... yes 12/25 ... yes 7/26 ... yes 12/27 ... yes 12/28 ... yes 12/29 ... yes 7/30 ... yes 7/31 ... yes 8/32 ... yes 32/33 ... yes 32/34 ... yes 7/35 ... yes 7/36 ... yes 7/37 ... yes 31/38 ... yes 7/39 ... yes 7/40 ... yes 31/41 ... yes 44/43 ... yes 50/44 ... yes 50/45 ... yes 50/46 ... yes 70/47 ... yes 68/48 ... yes 68/49 ... yes 73/50 ... yes 72/51 ... yes 68/52 ... yes 7/53 ... yes 6/54 ... yes 7/55 ... yes 89/56 ... yes 91/57 ... yes 91/58 ... yes 91/59 ... yes 89/60 ... yes 93/61 ... yes 94/62 ... yes 94/63 ... yes 98/64 ... yes 97/65 ... yes 89/66 ... yes 7/67 ... yes 89/68 ... yes 7/69 ... yes 90/70 ... yes 5/71 ... yes 49/72 ... yes 104/73 ... yes 82/74 ... yes 98/75 ... yes 7/77 ... yes 6/78 ... yes 12/79 ... yes 12/80 ... yes 199/81 ... yes 212/82 ... yes 216/83 ... yes 215/84 ... yes 215/85 ... yes 216/86 ... yes 215/87 ... yes 104/88 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.5) Git user has default SSH configuration? ... yes Active users: ... 57 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished