summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheogorath2018-10-04 20:43:39 +0200
committerSheogorath2018-10-04 20:45:25 +0200
commit3d1d03fa87c8ab788760fa74bae01f9dd917f019 (patch)
tree36a7ebd2b5bd78a6fa43b34f6e97411d4fb1e0d2
parentf186f733736a1e73fece235ef4952de7b703ec6c (diff)
Make oauth2 provider name accessible
Right now the feature exists but is almost not usable since the only way to configure it is to know that it exists from reading the source code and add it to config.json. This patch provides all needed changes so it can be used by everyone including documentation. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
-rw-r--r--README.md1
-rw-r--r--lib/config/default.js1
-rw-r--r--lib/config/environment.js1
3 files changed, 3 insertions, 0 deletions
diff --git a/README.md b/README.md
index 25388ec1..b2be7dd2 100644
--- a/README.md
+++ b/README.md
@@ -236,6 +236,7 @@ There are some config settings you need to change in the files below.
| `CMD_OAUTH2_AUTHORIZATION_URL` | `https://example.com` | authorization URL of your provider, please refer to the documentation of your OAuth2 provider (no default value) |
| `CMD_OAUTH2_CLIENT_ID` | `afae02fckafd...` | you will get this from your OAuth2 provider when you register CodiMD as OAuth2-client, (no default value) |
| `CMD_OAUTH2_CLIENT_SECRET` | `afae02fckafd...` | you will get this from your OAuth2 provider when you register CodiMD as OAuth2-client, (no default value) |
+| `CMD_OAUTH2_PROVIDERNAME` | `My institution` | Optional name to be displayed at login form indicating the oAuth2 provider |
| `CMD_IMGUR_CLIENTID` | no example | Imgur API client id |
| `CMD_EMAIL` | `true` or `false` | set to allow email signin |
| `CMD_ALLOW_PDF_EXPORT` | `true` or `false` | Enable or disable PDF exports |
diff --git a/lib/config/default.js b/lib/config/default.js
index c34279bd..d4d26db4 100644
--- a/lib/config/default.js
+++ b/lib/config/default.js
@@ -83,6 +83,7 @@ module.exports = {
},
// authentication
oauth2: {
+ providerName: undefined,
authorizationURL: undefined,
tokenURL: undefined,
clientID: undefined,
diff --git a/lib/config/environment.js b/lib/config/environment.js
index 6c4ce92f..c345abd9 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -75,6 +75,7 @@ module.exports = {
clientSecret: process.env.CMD_MATTERMOST_CLIENTSECRET
},
oauth2: {
+ providerName: process.env.CMD_OAUTH2_PROVIDERNAME,
baseURL: process.env.CMD_OAUTH2_BASEURL,
userProfileURL: process.env.CMD_OAUTH2_USER_PROFILE_URL,
userProfileUsernameAttr: process.env.CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR,