Fixing tenant loading problem

revert-70aa11f8
Megala 8 years ago
parent e8eb0123c7
commit 359bd8f317

@ -35,11 +35,6 @@ var onFail;
if (!context.input.samlToken) {
(new carbonServer.Server({url: devicemgtProps["adminService"]}))
.login(context.input.username, context.input.password);
} else {
var PrivilegedCarbonContext = Packages.org.wso2.carbon.context.PrivilegedCarbonContext;
PrivilegedCarbonContext.startTenantFlow();
var cxt = PrivilegedCarbonContext.getThreadLocalCarbonContext();
cxt.setTenantDomain(context.user.domain, true);
}
};

@ -525,15 +525,15 @@ var module = {};
}
/**
* @type {{sessionId: string, loggedInUser: string, sessionIndex: string, samlToken:
* string}}
* string}}
*/
var ssoSession = ssoClient.decodeSAMLLoginResponse(samlResponseObj, samlResponse,
session.getId());
if (ssoSession.sessionId) {
var ssoSessions = getSsoSessions();
ssoSessions[ssoSession.sessionId] = ssoSession;
if (ssoSessions.sessionIndex != null || ssoSessions.sessionIndex != 'undefined') {
module.loadTenant(ssoSessions.loggedInUser);
if (ssoSession.sessionIndex != null || ssoSession.sessionIndex != 'undefined') {
module.loadTenant(ssoSession.loggedInUser);
var carbonUser = (require("carbon")).server.tenantUser(ssoSession.loggedInUser);
utils.setCurrentUser(carbonUser.username, carbonUser.domain, carbonUser.tenantId);
var scriptArgument = {input: {samlToken: ssoSession.samlToken}, user: module.getCurrentUser()};

Loading…
Cancel
Save