Fixing the problem in login

revert-70aa11f8
Megala 8 years ago
parent bacd7ccfd2
commit b10c323582

@ -26,14 +26,16 @@ var onFail;
var utility = require("/app/modules/utility.js").utility; var utility = require("/app/modules/utility.js").utility;
var apiWrapperUtil = require("/app/modules/oauth/token-handlers.js")["handlers"]; var apiWrapperUtil = require("/app/modules/oauth/token-handlers.js")["handlers"];
if (context.input.samlToken) { if (context.input.samlToken) {
apiWrapperUtil.setupTokenPairBySamlGrantType(context.user.username, context.input.samlToken); apiWrapperUtil.setupTokenPairBySamlGrantType(context.user.username + '@' + context.user.domain, context.input.samlToken);
} else { } else {
apiWrapperUtil.setupTokenPairByPasswordGrantType(context.input.username, context.input.password); apiWrapperUtil.setupTokenPairByPasswordGrantType(context.input.username, context.input.password);
} }
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var carbonServer = require("carbon").server; var carbonServer = require("carbon").server;
if (!context.input.samlToken) {
(new carbonServer.Server({url: devicemgtProps["adminService"]})) (new carbonServer.Server({url: devicemgtProps["adminService"]}))
.login(context.input.username, context.input.password); .login(context.input.username, context.input.password);
}
}; };
onFail = function (error) { onFail = function (error) {

@ -105,7 +105,7 @@ var constants = {
CACHE_KEY_APP_CONF_FILE_LMD: "_UUF_APP_CONF_FILE_LMD", CACHE_KEY_APP_CONF_FILE_LMD: "_UUF_APP_CONF_FILE_LMD",
CACHE_KEY_LOOKUP_TABLE: "_UUF_LOOKUP_TABLE", CACHE_KEY_LOOKUP_TABLE: "_UUF_LOOKUP_TABLE",
CACHE_KEY_USER: "_UUF_USER", CACHE_KEY_USER: "_UUF_USER",
CACHE_KEY_SSO_SESSIONS: "_UUF_SSO_SESSIONS", CACHE_KEY_SSO_SESSIONS: "sso_sessions",
CACHE_KEY_HANDLEBARS_ROOT: "_UUF_HANDLEBARS_ROOT", CACHE_KEY_HANDLEBARS_ROOT: "_UUF_HANDLEBARS_ROOT",
// URL Query Params // URL Query Params
URL_PARAM_REFERER: "referer" URL_PARAM_REFERER: "referer"

@ -364,10 +364,10 @@ var module = {};
* samlToken: string}>} SSO sessions * samlToken: string}>} SSO sessions
*/ */
function getSsoSessions() { function getSsoSessions() {
var ssoSessions = application.get('sso_sessions'); var ssoSessions = application.get(constants.CACHE_KEY_SSO_SESSIONS);
if (!ssoSessions) { if (!ssoSessions) {
ssoSessions = {}; ssoSessions = {};
application.put('sso_sessions', ssoSessions); application.put(constants.CACHE_KEY_SSO_SESSIONS, ssoSessions);
} }
return ssoSessions; return ssoSessions;
} }

Loading…
Cancel
Save