summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenji <38424890+moserben16@users.noreply.github.com>2019-06-06 11:08:27 +0200
committerbmoser <benjaminmoser@ut11.net>2019-06-11 09:23:12 +0200
commitfd390d256066f538823111db6cef02f46e619750 (patch)
treeb60c0181f915019111f6e22aaa089bbcb53d40e2
parentd7bc8d100d1aec040e42ad9b632aa5a74fd54559 (diff)
downloadwekan-fd390d256066f538823111db6cef02f46e619750.tar.gz
wekan-fd390d256066f538823111db6cef02f46e619750.tar.bz2
wekan-fd390d256066f538823111db6cef02f46e619750.zip
Update oidc_server.js
with this fix, Authentication via OAuth2 with Google is possible. 1.) token endpoint and userinfo-endpoint in Google are different, so you have to check that, 2.) request the scopes of the environment variable "process.env.OAUTH2_REQUEST_PERMISSIONS" with this small little fix the login with google in oauth2-protocol gets possible :-) I would be very happy about a master-merge thank you in advance
-rw-r--r--packages/wekan-oidc/oidc_server.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/wekan-oidc/oidc_server.js b/packages/wekan-oidc/oidc_server.js
index ec615cd1..e826d1f5 100644
--- a/packages/wekan-oidc/oidc_server.js
+++ b/packages/wekan-oidc/oidc_server.js
@@ -49,7 +49,12 @@ if (Meteor.release) {
var getToken = function (query) {
var debug = process.env.DEBUG || false;
var config = getConfiguration();
- var serverTokenEndpoint = config.serverUrl + config.tokenEndpoint;
+ if(config.tokenEndpoint.includes('https://')){
+ var serverTokenEndpoint = config.tokenEndpoint;
+ }else{
+ var serverTokenEndpoint = config.serverUrl + config.tokenEndpoint;
+ }
+ var requestPermissions = config.requestPermissions;
var response;
try {
@@ -66,6 +71,7 @@ var getToken = function (query) {
client_secret: OAuth.openSecret(config.secret),
redirect_uri: OAuth._redirectUri('oidc', config),
grant_type: 'authorization_code',
+ scope: requestPermissions,
state: query.state
}
}