Properly wrap LoginExceptions as AuthenticationException as documentation says -...
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 16 Mar 2010 07:14:41 +0000 (07:14 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 16 Mar 2010 07:14:41 +0000 (07:14 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2923 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

doc/RELEASE-NOTES.txt
src/main/java/edu/internet2/middleware/shibboleth/idp/authn/provider/UsernamePasswordLoginServlet.java

index 2243f00..04ea9d8 100644 (file)
@@ -1,5 +1,6 @@
 Changes in Release 2.2.0
 =============================================
+[SIDP-379] - Usage of general AuthenticationException in UsernamePasswordLoginHandler
 [SIDP-373] - The SLF4J MDC state is not being properly cleared when request processing is done.
 [SIDP-368] - Provide more acurate login error to servlet when Username/Password login authentication has failed.
 [SIDP-365] - Expose uptime of IdP web application with status handler
index 296e5d6..3363c3e 100644 (file)
@@ -38,6 +38,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import edu.internet2.middleware.shibboleth.idp.authn.AuthenticationEngine;
+import edu.internet2.middleware.shibboleth.idp.authn.AuthenticationException;
 import edu.internet2.middleware.shibboleth.idp.authn.LoginHandler;
 import edu.internet2.middleware.shibboleth.idp.authn.UsernamePrincipal;
 
@@ -106,7 +107,7 @@ public class UsernamePasswordLoginServlet extends HttpServlet {
             AuthenticationEngine.returnToAuthenticationEngine(request, response);
         } catch (LoginException e) {
             request.setAttribute(failureParam, "true");
-            request.setAttribute(LoginHandler.AUTHENTICATION_EXCEPTION_KEY, e);
+            request.setAttribute(LoginHandler.AUTHENTICATION_EXCEPTION_KEY, new AuthenticationException(e));
             redirectToLoginPage(request, response);
         }
     }