mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixing tenant loading problem
This commit is contained in:
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…
Reference in New Issue
Block a user