From 0d574b4f72b308034267d8be9836111256134f98 Mon Sep 17 00:00:00 2001 From: "Angus B. Grieve-Smith" Date: Wed, 27 May 2020 17:11:52 -0400 Subject: [PATCH 1/2] Updated README with instructions on updating redirect_uri in the database --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 18e3928..cc0d895 100755 --- a/README.md +++ b/README.md @@ -173,7 +173,14 @@ vim config_init.sh ./init_postgres.sh ``` -This script will automatically create and add a new client in the Oauth server, returning a client id and a client secret. You need to keep these two token to configure Mattermost. Please be sure the client secret remained secret. The redirect url in the script must comply with the hostname of your Mattermost server, else Mattermost could not get data from the Oauth server. +This script will automatically create and add a new client in the Oauth server, returning a client id and a client secret. You need to keep these two token to configure Mattermost. Please be sure the client secret remained secret. + +The redirect uri in the script must comply with the hostname of your +Mattermost server, or else Mattermost will not be able to get data from +the Oauth server. If you update your hostname, you will need to update +this value. Here is an example query: + +```UPDATE oauth_clients SET redirect_uri = 'https://example.com/signup/gitlab/complete' WHERE client_id = '1234567890';``` ## Configuration From 8202da0237a9f970d66636c20267e82016149485 Mon Sep 17 00:00:00 2001 From: Denis CLAVIER Date: Thu, 28 May 2020 11:35:13 +0200 Subject: [PATCH 2/2] Add note about redirect_uri --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cc0d895..5afbc16 100755 --- a/README.md +++ b/README.md @@ -175,12 +175,15 @@ vim config_init.sh This script will automatically create and add a new client in the Oauth server, returning a client id and a client secret. You need to keep these two token to configure Mattermost. Please be sure the client secret remained secret. -The redirect uri in the script must comply with the hostname of your -Mattermost server, or else Mattermost will not be able to get data from -the Oauth server. If you update your hostname, you will need to update -this value. Here is an example query: +The redirect uri in the script must comply with the hostname of your Mattermost server, or else Mattermost will not be able to get data from the Oauth server. If you update your hostname, you will need to update this value. Here is an example query: -```UPDATE oauth_clients SET redirect_uri = 'https://example.com/signup/gitlab/complete' WHERE client_id = '1234567890';``` +```sql +UPDATE oauth_clients SET redirect_uri = 'https://mattermost.company.com/signup/gitlab/complete' WHERE client_id = '1234567890'; +``` + +**Warning** : The `redirect_uri` parameter should be strictly the same as the one given by Mattermost to Oauth server during authentication. If your Mattermost server uses HTTPS, make sure the `redirect_uri` begin with `https`. + +*Note* : Mattermost build the `redirect_url` from the parameter `SiteURL` in `config.json`. Thus, if you set this parameter to `https://mattermost.company.com`, Mattermost will use the following redirect URL : http**s**://mattermost.company.com/signup/gitlab/complete (`SiteURL` + '/signup/gitlab/complete'). ## Configuration