1
0
Fork 0

renamed config property names

This commit is contained in:
Ruben Meyer 2020-01-12 21:37:16 +01:00
parent 6bc814bd50
commit a3fe0e0091
3 changed files with 7 additions and 14 deletions

View File

@ -19,7 +19,7 @@ module.exports = {
}, },
sso: { sso: {
authenticator: "http://localhost:8080/api/authenticate", // redirect back to this url; authenticator: "http://localhost:8080/api/authenticate", // redirect back to this url;
redirectUser: "https://auth.rxbn.de/authenticate", // sso service provider: "https://auth.rxbn.de/authenticate", // sso service
appId: process.env.APP_ID, // app id appId: process.env.APP_ID, // app id
appSecret: process.env.APP_SECRET // random token appSecret: process.env.APP_SECRET // random token
}, },

View File

@ -21,7 +21,7 @@ functions.authenticateUser = (obj, callback) => {
request({ request({
method: 'POST', method: 'POST',
uri: global['gds'].cfg.sso.authenticator, uri: global['gds'].cfg.sso.provider,
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
@ -55,7 +55,7 @@ functions.createAuthentication = (obj) => {
redirectUrl: obj.url, redirectUrl: obj.url,
appId: obj.appId appId: obj.appId
}; };
return global['gds'].cfg.sso.redirectUser+"?"+querystring.stringify(nUrl); return global['gds'].cfg.sso.provider+"?"+querystring.stringify(nUrl);
}; };
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -1,25 +1,18 @@
var express = require('express'); var express = require('express');
var route = express.Router(); var route = express.Router();
route.get('/register', (req, res) => {
if(!global['gds'].cfg.web.registration) {
return res.type('json').status(400).end(JSON.stringify({status: 400, message: "msg.auth.registration.deactivated"}));
}
// TODO: register
});
route.get('/login', (req, res) => { route.get('/login', (req, res) => {
// TODO: login // TODO: login
let a = global['modules'].sso.createAuthentication({ let a = global['modules'].sso.createAuthentication({
url: global['gds'].cfg.sso.authenticator, url: global['gds'].cfg.sso.authenticator,
appId: global['gds'].cfg.sso.appId appId: global['gds'].cfg.sso.appId
}) });
console.log(a); res.redirect(a);
res.end('login');
}); });
route.post('/authenticate', (req, res) => { route.get('/authenticate', (req, res) => {
// TODO: authenticate // TODO: authenticate
res.end();
}); });
route.get('/logout', (req, res) => { route.get('/logout', (req, res) => {