Skip to content
Snippets Groups Projects
Commit f972225a authored by srosse's avatar srosse
Browse files

OMA-17: fix an issue where the window are not registred during the single sign-on process

parent 34a1dd07
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,6 @@ import javax.servlet.http.HttpSession; ...@@ -44,7 +44,6 @@ import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionBindingEvent; import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener; import javax.servlet.http.HttpSessionBindingListener;
import org.apache.log4j.Logger;
import org.olat.core.commons.persistence.DBFactory; import org.olat.core.commons.persistence.DBFactory;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.gui.control.Disposable; import org.olat.core.gui.control.Disposable;
...@@ -115,7 +114,6 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList ...@@ -115,7 +114,6 @@ public class UserSession implements HttpSessionBindingListener, GenericEventList
//usersession is listening for SignOnOffEvents from other clusternodes //usersession is listening for SignOnOffEvents from other clusternodes
CoordinatorManager.getInstance().getCoordinator().getEventBus().registerFor(this, null, ORES_USERSESSION); CoordinatorManager.getInstance().getCoordinator().getEventBus().registerFor(this, null, ORES_USERSESSION);
registeredWithBus = true; registeredWithBus = true;
Logger.getLogger(getClass().getName()).debug("UserSession<init> END");
} }
/** /**
......
...@@ -190,7 +190,11 @@ public class RESTDispatcher implements Dispatcher { ...@@ -190,7 +190,11 @@ public class RESTDispatcher implements Dispatcher {
} else if (Windows.getWindows(usess).getAttribute("AUTHCHIEFCONTROLLER") == null) { } else if (Windows.getWindows(usess).getAttribute("AUTHCHIEFCONTROLLER") == null) {
// Session is already available, but no main window (Head-less REST // Session is already available, but no main window (Head-less REST
// session). Only create the base chief controller and the window // session). Only create the base chief controller and the window
AuthHelper.createAuthHome(ureq); Window currentWindow = AuthHelper.createAuthHome(ureq).getWindow();
//the user is authenticated successfully with a security token, we can set the authenticated path
currentWindow.setUriPrefix(WebappHelper.getServletContextPath() + DispatcherAction.PATH_AUTHENTICATED);
Windows ws = Windows.getWindows(ureq);
ws.registerWindow(currentWindow);
// no need to call setIdentityAsActive as this was already done by RestApiLoginFilter... // no need to call setIdentityAsActive as this was already done by RestApiLoginFilter...
} }
} }
...@@ -293,11 +297,11 @@ public class RESTDispatcher implements Dispatcher { ...@@ -293,11 +297,11 @@ public class RESTDispatcher implements Dispatcher {
private String getRedirectToURL(UserSession usess) { private String getRedirectToURL(UserSession usess) {
ChiefController cc = (ChiefController) Windows.getWindows(usess).getAttribute("AUTHCHIEFCONTROLLER"); ChiefController cc = (ChiefController) Windows.getWindows(usess).getAttribute("AUTHCHIEFCONTROLLER");
Window w = cc.getWindow(); Window w = cc.getWindow();
URLBuilder ubu = new URLBuilder("", w.getInstanceId(), String.valueOf(w.getTimestamp()), null); URLBuilder ubu = new URLBuilder(WebappHelper.getServletContextPath() + DispatcherAction.PATH_AUTHENTICATED, w.getInstanceId(), String.valueOf(w.getTimestamp()), null);
StringOutput sout = new StringOutput(30); StringOutput sout = new StringOutput(30);
ubu.buildURI(sout, null, null); ubu.buildURI(sout, null, null);
return WebappHelper.getServletContextPath() + DispatcherAction.PATH_AUTHENTICATED + sout.toString(); return sout.toString();
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment