public String getUrlName() {
return "activiti-explorer";
}
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
ProxiedWebApplication webApp = getProxyWebApplication(req);
HttpSession session = req.getSession();
HttpSession ps = webApp.getProxiedSession(session);
UserDTO oldUser = (UserDTO)ps.getAttribute("jenkins.user");
UserDTO newUser = createUserInfo();
if (!mapToId(oldUser).equals(mapToId(newUser))) {
// force a new session. AE isn't designed to anticipate the user change without invalidating a session,
// but Jenkins does that. So when we see that the user has changed in Jenkins, force a new session
// (but only in AE.)
webApp.clearProxiedSession(session);
ps = webApp.getProxiedSession(session);
}
ps.setAttribute("jenkins.user", newUser);
webApp.handleRequest(req, rsp);
}