[java-shib-idp2 COMMIT] in /branches/REL_2: doc/RELEASE-NOTES.txt src/main/java/edu/internet2/middleware/shibboleth/i...

noreply at shibboleth.net noreply at shibboleth.net
Mon Oct 10 19:51:14 BST 2011


Author: lajoie
Date: Mon Oct 10 19:51:14 2011
New Revision: 3075

URL: http://svn.shibboleth.net/view/java-shib-idp2?rev=3075&view=rev
Log:
Log, on debug, when login handlers report an error during authentication - SIDP-510

Modified:
    branches/REL_2/doc/RELEASE-NOTES.txt
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java

Modified: branches/REL_2/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/doc/RELEASE-NOTES.txt?rev=3075&r1=3074&r2=3075&view=diff
==============================================================================
--- branches/REL_2/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_2/doc/RELEASE-NOTES.txt Mon Oct 10 19:51:14 2011
@@ -1,5 +1,6 @@
 Changes in Release 2.3.4
 =============================================
+[SIDP-510] - Error with stack trace when passive cannot be honored
 [SIDP-511] - ExternalAuthnSystemLoginHandler does not support forceAuthn/isPassive
 [SIDP-513] - idpui taglib could look for more languages matches
 [SIDP-514] - Alt text for IdP Logos is not esapiEncoder.encodeForHTMLAttribute

Modified: branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java?rev=3075&r1=3074&r2=3075&view=diff
==============================================================================
--- branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java (original)
+++ branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/authn/AuthenticationEngine.java Mon Oct 10 19:51:14 2011
@@ -531,6 +531,9 @@
 
             // Check to make sure the login handler did the right thing
             validateSuccessfulAuthentication(loginContext, httpRequest, actualAuthnMethod);
+            if(loginContext.getAuthenticationFailure() != null){
+                returnToProfileHandler(httpRequest, httpResponse);
+            }
 
             // Check for an overridden authn instant.
             DateTime actualAuthnInstant = (DateTime) httpRequest.getAttribute(LoginHandler.AUTHENTICATION_INSTANT_KEY);
@@ -584,15 +587,21 @@
         String errorMessage = DatatypeHelper.safeTrimOrNullString((String) httpRequest
                 .getAttribute(LoginHandler.AUTHENTICATION_ERROR_KEY));
         if (errorMessage != null) {
-            LOG.error("Error returned from login handler for authentication method {}:\n{}",
+            LOG.debug("Error returned from login handler for authentication method {}:\n{}",
                     loginContext.getAttemptedAuthnMethod(), errorMessage);
-            throw new AuthenticationException(errorMessage);
+            loginContext.setAuthenticationFailure(new AuthenticationException(errorMessage));
+            loginContext.setPrincipalAuthenticated(false);
+            return;
         }
 
         AuthenticationException authnException = (AuthenticationException) httpRequest
                 .getAttribute(LoginHandler.AUTHENTICATION_EXCEPTION_KEY);
         if (authnException != null) {
-            throw authnException;
+            LOG.debug("Exception returned from login handler for authentication method {}:\n{}",
+                    loginContext.getAttemptedAuthnMethod(), authnException);
+            loginContext.setAuthenticationFailure(authnException);
+            loginContext.setPrincipalAuthenticated(false);
+            return;
         }
 
         Subject subject = (Subject) httpRequest.getAttribute(LoginHandler.SUBJECT_KEY);



More information about the commits mailing list