summaryrefslogtreecommitdiffstats
path: root/server/authentication.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-08-25 00:49:02 +0300
committerLauri Ojansivu <x@xet7.org>2018-08-25 00:49:02 +0300
commit39312a075e5746ddeccbf3fc22df7177a86ba4d5 (patch)
treecfe58a957d423cedfdfa27368ad14c6e0d78ea00 /server/authentication.js
parent96173ad4314cf783f4f7d9c0278762f144d95758 (diff)
downloadwekan-39312a075e5746ddeccbf3fc22df7177a86ba4d5.tar.gz
wekan-39312a075e5746ddeccbf3fc22df7177a86ba4d5.tar.bz2
wekan-39312a075e5746ddeccbf3fc22df7177a86ba4d5.zip
- [OAuth2 Login on Standalone Wekan](https://github.com/wekan/wekan/wiki/OAuth2). For example, Rocket.Chat can provide OAuth2 login to Wekan.
Also, if you have Rocket.Chat using LDAP/SAML/Google/etc for logging into Rocket.Chat, then same users can login to Wekan when Rocket.Chat is providing OAuth2 login to Wekan. Thanks to salleman33 and xet7 ! Closes #234
Diffstat (limited to 'server/authentication.js')
-rw-r--r--server/authentication.js34
1 files changed, 19 insertions, 15 deletions
diff --git a/server/authentication.js b/server/authentication.js
index a6872376..6310e8df 100644
--- a/server/authentication.js
+++ b/server/authentication.js
@@ -63,23 +63,27 @@ Meteor.startup(() => {
};
if (Meteor.isServer) {
- ServiceConfiguration.configurations.upsert(
- { service: 'oidc' },
- {
- $set: {
- loginStyle: 'redirect',
- clientId: 'CLIENT_ID',
- secret: 'SECRET',
- serverUrl: 'https://my-server',
- authorizationEndpoint: '/oauth/authorize',
- userinfoEndpoint: '/oauth/userinfo',
- tokenEndpoint: '/oauth/token',
- idTokenWhitelistFields: [],
- requestPermissions: ['openid']
+
+ if(process.env.OAUTH2_CLIENT_ID !== '') {
+
+ ServiceConfiguration.configurations.upsert( // eslint-disable-line no-undef
+ { service: 'oidc' },
+ {
+ $set: {
+ loginStyle: 'redirect',
+ clientId: process.env.OAUTH2_CLIENT_ID,
+ secret: process.env.OAUTH2_SECRET,
+ serverUrl: process.env.OAUTH2_SERVER_URL,
+ authorizationEndpoint: process.env.OAUTH2_AUTH_ENDPOINT,
+ userinfoEndpoint: process.env.OAUTH2_USERINFO_ENDPOINT,
+ tokenEndpoint: process.env.OAUTH2_TOKEN_ENDPOINT,
+ idTokenWhitelistFields: [],
+ requestPermissions: ['openid'],
+ },
}
- }
- );
+ );
}
+ }
});