From de2ea4c96a007cd1c6545f0b4a063d3392a1a0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Thu, 15 Oct 2015 16:48:38 +0200 Subject: Implemented python login using authenticated SAML credentials. --- web/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'web') 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(); -- cgit v1.2.1