Crivaledaz / Mattermost-LDAP

This module provides an external LDAP authentication in Mattermost for the Team Edition (free).
MIT License
359 stars 71 forks source link

Bad token type #16

Closed Rudloff closed 5 years ago

Rudloff commented 6 years ago

Hello,

When I try to login, Mattermost complains about a bad token type after I authorize access. I get this in Mattermost logs:

[2017/11/14 17:22:22 CET] [EROR] AuthorizeOAuthUser: Mauvais type de jeton, token_type=, response_body= {"error":"redirect_uri_mismatch","error_description":"The redirect URI is missing or do not match","error_uri":"http:\/\/tools.ietf.org\/html\/rfc6749#section-4.1.3"}

I have double-checked redirect_uri in the oauth_clients table contains the correct URL (https://example.com/signup/gitlab/complete). The base URL is the same as defined in ServiceSettings.SiteURL in Mattermost's config file.

maykel535 commented 6 years ago

I have a same problem... I follow these step bad I get this error when go to the gitlab buton in login:

{"error":"redirect_uri_mismatch","error_description":"The redirect URI provided is missing or does not match","error_uri":"http:\/\/tools.ietf.org\/html\/rfc6749#section-3.1.2"}

I have install the mattermost 4.8

Thanks in advanced.

Crivaledaz commented 5 years ago

I close this issue since there is no update for ten months. Feel free to reopen it if you still have the problem.

Regards

Alexandr-Kalinin commented 5 years ago

Hello.

I have the same problem when I click on the gitlab button, I get this error {"error":"redirect_uri_mismatch","error_description":"The redirect URI provided is missing or does not match","error_uri":"http://tools.ietf.org/html/rfc6749#section-3.1.2"}

Request URL: https://mattemost-ldap.MYDOMAIN.com:8080/oauth/authorize.php?response_type=code&client_id=cc64788861ce88fe4676d6e2fbf9ad3c198d43fd5cc2bd0d9a973d11a12f3543&redirect_uri=https%3A%2F%2Fmattermost.MYDOMAIN.com%2Fsignup%2Fgitlab%2Fcomplete&state=eyJhY3Rpb24iOissb2dpgiIsInRva2buIjoiewZxbmoeeDl3NWNkM25ueWs5j3N4cgk2MTFjb3o5dDhucnplanR0eGh2dDhtZHB3a3Q2eXJkaXdrbmNwaTd3eSJ5 Request Method: Status Code: 400 Bad Request

Crivaledaz commented 5 years ago

Hi,

You have certainly checked already, but redirect_uri in the oauth_clients table must be exactly the same value as the parameter redirect_uri in the request URL. Especially, if you use HTTPS, the redirect_uri in the table should be in HTTPS.

So in your case, in the table, the redirect_uri should contain "https://mattermost.MYDOMAIN.com/signup/gitlab/complete".

In addition, you can try solutions proposed in issue #30 or try to debug with the curl method describe in issue #5.

I hope these will solve your problem, please give me your feedback,

Regards

Alexandr-Kalinin commented 5 years ago

hello

I did a reinstall mattermost-ldap and now I get an HTTP error ERROR 401 what could be the problem?

turtle-bazon commented 4 years ago

I have the same problem. After setting mattermost behind apache proxy and correcting redirect_uri in oauth_cilents problem appeared. Without apache proxy all fine. Tried to proxy via nginx and without domain names - all ok.