+
+ if (currentAuth == null && Display.getCurrent() != null) {
+ // try to load authentication from session
+ HttpServletRequest httpRequest = RWT.getRequest();
+ HttpSession httpSession = httpRequest.getSession();
+ // log.debug(httpSession.getId());
+ Object contextFromSessionObject = httpSession
+ .getAttribute(SPRING_SECURITY_CONTEXT_KEY);
+ if (contextFromSessionObject != null) {
+ currentAuth = (Authentication) contextFromSessionObject;
+ SecurityContextHolder.getContext().setAuthentication(
+ currentAuth);
+ }
+ }
+
+ // thread already logged in