Add some logging messages
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 Sep 2007 01:09:09 +0000 (01:09 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 Sep 2007 01:09:09 +0000 (01:09 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2383 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java
src/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java

index ec5c8e5..934e86d 100644 (file)
@@ -85,6 +85,9 @@ public class AuthenticationEngine extends HttpServlet {
         }
         HttpSession httpSession = httpRequest.getSession();
         LoginContext loginContext = (LoginContext) httpSession.getAttribute(LoginContext.LOGIN_CONTEXT_KEY);
         }
         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);
     }
 
         forwardRequest(loginContext.getAuthenticationEngineURL(), httpRequest, httpResponse);
     }
 
index 9bb6858..f198ba9 100644 (file)
@@ -121,7 +121,7 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
     /** {@inheritDoc} */
     public void processRequest(HTTPInTransport inTransport, HTTPOutTransport outTransport) throws ProfileException {
         HttpServletRequest servletRequest = ((HttpServletRequestAdapter) inTransport).getWrappedRequest();
     /** {@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);
 
         if (httpSession.getAttribute(LoginContext.LOGIN_CONTEXT_KEY) == null) {
             performAuthentication(inTransport, outTransport);
@@ -156,6 +156,7 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
                         + requestContext.getInboundMessageIssuer());
             }
 
                         + 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);
             Saml2LoginContext loginContext = new Saml2LoginContext(relyingPartyId, requestContext.getRelayState(),
                     requestContext.getInboundSAMLMessage());
             loginContext.setAuthenticationEngineURL(authenticationManagerPath);