From 37eada4de09994b7aeade09a720653ed28c1f552 Mon Sep 17 00:00:00 2001 From: Mohamed ABDELLANI Date: Tue, 2 Jun 2020 20:36:26 +0100 Subject: [PATCH] define the file that will store users database for the saml Idp --- .../src/components/settings/sso/SsoModal.js | 5 +++- backend/backend/api/user.js | 4 ++-- saml/users.php | 23 +++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 saml/users.php diff --git a/admin-dashboard/src/components/settings/sso/SsoModal.js b/admin-dashboard/src/components/settings/sso/SsoModal.js index c53b483a9e..8893835696 100644 --- a/admin-dashboard/src/components/settings/sso/SsoModal.js +++ b/admin-dashboard/src/components/settings/sso/SsoModal.js @@ -51,7 +51,10 @@ const fields = [ name="saml-enabled" id="saml-enabled" /> - + ), }, diff --git a/backend/backend/api/user.js b/backend/backend/api/user.js index ebc15be840..1819752390 100755 --- a/backend/backend/api/user.js +++ b/backend/backend/api/user.js @@ -291,8 +291,8 @@ router.get('/sso/login', async function(req, res) { sso_login_url: samlSsoUrl, }); - sp.create_login_request_url(idp, {}, function(err, login_url) { - if (err != null) return sendErrorResponse(req, res, error); + sp.create_login_request_url(idp, {}, function(error, login_url) { + if (error != null) return sendErrorResponse(req, res, error); return sendItemResponse(req, res, { url: login_url }); }); } catch (error) { diff --git a/saml/users.php b/saml/users.php new file mode 100644 index 0000000000..e4a2d38c23 --- /dev/null +++ b/saml/users.php @@ -0,0 +1,23 @@ + array( + 'core:AdminPassword', + ), + + 'example-userpass' => array( + 'exampleauth:UserPass', + 'user1:user1pass' => array( + 'uid' => array('1'), + 'eduPersonAffiliation' => array('group1'), + 'email' => 'user1@tests.hackerbay.io', + ), + 'user2:user2pass' => array( + 'uid' => array('2'), + 'eduPersonAffiliation' => array('group2'), + 'email' => 'user2@tests.hackerbay.io', + ), + ), + +); \ No newline at end of file