LOG.debug("Creating shibboleth session for principal {}", principalName);
shibSession = (Session) getSessionManager().createSession(loginContext.getPrincipalName());
loginContext.setSessionID(shibSession.getSessionID());
- httpRequest.setAttribute(Session.HTTP_SESSION_BINDING_ATTRIBUTE, shibSession);
+ httpRequest.getSession().setAttribute(Session.HTTP_SESSION_BINDING_ATTRIBUTE, shibSession);
}
LOG.debug("Recording authentication and service information in Shibboleth session for principal: {}",
authnMethodInfo);
shibSession.getServicesInformation().put(serviceInfo.getEntityID(), serviceInfo);
- shibSession.setLastActivityInstant(new DateTime());
-
returnToProfileHandler(loginContext, httpRequest, httpResponse);
}
*/
protected void addIdPSessionCookieToResponse(HttpServletRequest request, HttpServletResponse response,
Session userSession) {
- if (userSession == null) {
- userSession = (Session) request.getAttribute(Session.HTTP_SESSION_BINDING_ATTRIBUTE);
+ Session currentSession = userSession;
+ if (currentSession == null) {
+ currentSession = (Session) request.getAttribute(Session.HTTP_SESSION_BINDING_ATTRIBUTE);
+ if (currentSession == null) {
+ currentSession = (Session) request.getSession().getAttribute(Session.HTTP_SESSION_BINDING_ATTRIBUTE);
+ }
}
- if (userSession != null) {
+ if (currentSession != null) {
Cookie sessionCookie = new Cookie(IDP_SESSION_COOKIE_NAME, userSession.getSessionID());
sessionCookie.setDomain(request.getLocalName());
sessionCookie.setPath(request.getContextPath());