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

Cannot Login with gitlab #8636

Closed
bdkakdb opened this issue Apr 17, 2018 · 12 comments

Comments

Projects
None yet
7 participants
@bdkakdb
Copy link

commented Apr 17, 2018

Summary

When I log in using the gitlab SSO I get "Bad response from token request"

Steps to reproduce

GitlabCE 10.6.2
Mattermost 4.9.0

I have added Mattermost to the applications in gitlab (Tried both, user applications and applications in admin area, result is the same).
When I click on sign in with Gitlab, I get redirected to gitlab, sign in there, authorize mattermost and get redirected back to mattermost. there I am getting:

Error

Bad response from token request
Back to Mattermost

In the mattermost logs, I see:

[2018/04/17 13:01:56 CEST] [DEBG] /
[2018/04/17 13:01:57 CEST] [DEBG] GET - /api/v4/config/client
[2018/04/17 13:01:57 CEST] [DEBG] GET - /api/v4/license/client
[2018/04/17 13:01:57 CEST] [DEBG] GET - /api/v4/plugins/webapp
[2018/04/17 13:01:59 CEST] [DEBG] GET - /oauth/gitlab/login
[2018/04/17 13:02:03 CEST] [DEBG] GET - /signup/gitlab/complete
[2018/04/17 13:02:04 CEST] [EROR] AuthorizeOAuthUser: Bad response from token request, response_body=
[2018/04/17 13:02:04 CEST] [DEBG] /error
[2018/04/17 13:02:05 CEST] [DEBG] GET - /api/v4/config/client
[2018/04/17 13:02:05 CEST] [DEBG] GET - /api/v4/license/client
[2018/04/17 13:02:06 CEST] [DEBG] GET - /api/v4/plugins/webapp

@jasonblais

This comment has been minimized.

Copy link
Member

commented Apr 17, 2018

@bdkakdb Is this a new issue after upgrading to Mattermost v4.9?

Also, have you set your Site URL field in System Console > Configuration? https://docs.mattermost.com/administration/config-settings.html#site-url

@bdkakdb

This comment has been minimized.

Copy link
Author

commented Apr 17, 2018

  • This is a fresh setup using docker compose -> no update
  • I have set my site-url correctly -> Withouth that redirect from gitlab would not work (It compares the redirect urls to the ones given). Does any backend need to access the Site-Url (because docker container might not be able to resolve the name)?
@hmhealey

This comment has been minimized.

Copy link
Member

commented Apr 18, 2018

@bdkakdb Regarding your second point there, Mattermost needs to be able to talk to GitLab, so if they can't communicate, that might explain why login doesn't work

@vidister

This comment has been minimized.

Copy link

commented Apr 19, 2018

I'm experiencing the same issue but reverse.
I'm running Mattermost as the oauth provider and gitlab as client.
I've tested it with Mattermost 4.8.0 and 4.9.0. Gitlab is 10.6.4-ee. The instances are installed on two VMs, both having an nginx proxy in front of them, they can talk to each other. the site-url is set correctly.

@bdkakdb

This comment has been minimized.

Copy link
Author

commented Apr 23, 2018

@hmhealey The mattermost container is able to get to via ip only. I have attached to the container and checked it.

@hmhealey

This comment has been minimized.

Copy link
Member

commented Apr 25, 2018

@bdkakdb Alright, so the servers will need to be communicate using the addresses contained in the GitLabSettings.*Endpoint settings in Mattermost. I think it should work if they're configured with the IP address, but if they're configured with the domain name, it won't work right now

@vidister Are there any errors in the Mattermost or GitLab logs when you try to connect? They should contain some more information than is just available in the UI

@lindy65

This comment has been minimized.

Copy link
Member

commented May 2, 2018

Hi @bdkakdb @vidister

Has your issue been resolved? Is it ok for me to close off this issue here?

@amyblais

This comment has been minimized.

Copy link
Member

commented May 17, 2018

Hi @bdkakdb and @vidister , we haven't received an update so we'll assume that the problem is fixed or is no longer valid.

If you still experience the same problem, try upgrading to the latest version.

If the issue persists, reopen this issue with the relevant information and we'd be glad to help you where we can.

@amyblais amyblais closed this May 17, 2018

@uhlhosting

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2019

@jasonblais I might had reached same issue, guess is a bug somewhere.

@uhlhosting

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2019

The throlling of API locked and it never unlocked in my opinion.

@jasonblais

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

Is the issue reproducible?

@uhlhosting

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2019

Is the issue reproducible?
@jasonblais
This would require more local debugging at this point. I had to disable 2nd auth via GitLab, while there are some issues with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.