}
HttpSession httpSession = httpRequest.getSession();
LoginContext loginContext = (LoginContext) httpSession.getAttribute(LoginContext.LOGIN_CONTEXT_KEY);
+ if(loginContext == null){
+ LOG.error("User HttpSession did not contain a login context. Unable to return to authentication engine");
+ }
forwardRequest(loginContext.getAuthenticationEngineURL(), httpRequest, httpResponse);
}
/** {@inheritDoc} */
public void processRequest(HTTPInTransport inTransport, HTTPOutTransport outTransport) throws ProfileException {
HttpServletRequest servletRequest = ((HttpServletRequestAdapter) inTransport).getWrappedRequest();
- HttpSession httpSession = servletRequest.getSession();
+ HttpSession httpSession = servletRequest.getSession(true);
if (httpSession.getAttribute(LoginContext.LOGIN_CONTEXT_KEY) == null) {
performAuthentication(inTransport, outTransport);
+ requestContext.getInboundMessageIssuer());
}
+ log.debug("Creating login context and transferring control to authentication engine");
Saml2LoginContext loginContext = new Saml2LoginContext(relyingPartyId, requestContext.getRelayState(),
requestContext.getInboundSAMLMessage());
loginContext.setAuthenticationEngineURL(authenticationManagerPath);