Fix bug where authentication method information was being re-recorded every authentic...
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 23 Aug 2010 18:17:35 +0000 (18:17 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 23 Aug 2010 18:17:35 +0000 (18:17 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2944 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java

index 50945a0..daf9633 100644 (file)
@@ -148,15 +148,6 @@ public class AuthenticationEngine extends HttpServlet {
             forwardRequest("/error.jsp", httpRequest, httpResponse);
         } else {
             forwardRequest(loginContext.getAuthenticationEngineURL(), httpRequest, httpResponse);
-            // URLBuilder urlBuilder = HttpServletHelper.getServletContextUrl(httpRequest);
-            // urlBuilder.setPath(urlBuilder.getPath() + loginContext.getAuthenticationEngineURL());
-            // String authnEngineUrl = urlBuilder.buildURL();
-            // LOG.debug("Redirecting user to authentication engine at {}", authnEngineUrl);
-            // try{
-            // httpResponse.sendRedirect(authnEngineUrl);
-            // }catch(IOException e){
-            // LOG.warn("Error sending user back to authentication engine at " + authnEngineUrl, e);
-            // }
         }
     }
 
@@ -702,8 +693,8 @@ public class AuthenticationEngine extends HttpServlet {
         idpSession.setSubject(mergeSubjects(idpSession.getSubject(), authenticationSubject));
 
         // Check if an existing authentication method was used (i.e. SSO occurred), if not record the new information
-        AuthenticationMethodInformation authnMethodInfo = loginContext.getAuthenticationMethodInformation();
-        if (authnMethodInfo == null || !authnMethodInfo.getAuthenticationMethod().equals(authenticationMethod)) {
+        AuthenticationMethodInformation authnMethodInfo = idpSession.getAuthenticationMethods().get(authenticationMethod);
+        if (authnMethodInfo == null) {
             LOG.debug("Recording authentication and service information in Shibboleth session for principal: {}",
                     authenticationPrincipal.getName());
             LoginHandler loginHandler = handlerManager.getLoginHandlers().get(loginContext.getAttemptedAuthnMethod());