diff options
author | Aleš Smodiš <aless@guru.si> | 2015-10-15 16:48:38 +0200 |
---|---|---|
committer | Aleš Smodiš <aless@guru.si> | 2015-10-15 16:48:38 +0200 |
commit | de2ea4c96a007cd1c6545f0b4a063d3392a1a0d3 (patch) | |
tree | c6277ba0c950a7b20d14dd4796c00b14140d8d82 /web | |
parent | 1203ad99f5676a26fba189bfae4259c0bf09eac1 (diff) |
Implemented python login using authenticated SAML credentials.
Diffstat (limited to 'web')
-rw-r--r-- | web/main.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/web/main.js b/web/main.js index 21f639d..67d4274 100644 --- a/web/main.js +++ b/web/main.js @@ -132,7 +132,7 @@ var guiHandlers = { handleResponse = function (res) { var chunks = [], status = res.statusCode, - headers, i, m; + headers, i, m, pythonRequest, keys; if (status !== 200) { guiResponse.code = -2; guiResponse.message = 'Received an error from the identity server: ' + status + ' ' + res.statusMessage; @@ -157,7 +157,7 @@ var guiHandlers = { catch (e) { guiResponse.code = -3; guiResponse.message = 'Response from the identity server is not a JSON: ' + e; - logger.error(guiResponse.message + '\n' + chunks.join(''), e); + logException(guiResponse.message + '\n' + chunks.join(''), e); session.send(guiResponse); return; } @@ -167,14 +167,15 @@ var guiHandlers = { session.send(guiResponse); } else { - sendDataToPython({'action': 'saml_login', 'tid': message.tid, 'sid': message.sid, 'data': m.data && m.data.userData}) + message.saml_data = m.data && m.data.userData; // add the data from SAML authentication, and forward everything to Python + sendDataToPython(message) .then(function (jsonReply) { session.samlData = m.data; // perhaps we'll need the SAML data in the future session.send(jsonReply); }, function (exc) { guiResponse.code = -6; guiResponse.message = 'Python processing of SAML login generated an error: ' + exc; - logger.error(guiResponse.message, exc); + logException(guiResponse.message, exc); session.send(guiResponse); }) .done(); |