You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2020/05/07 07:26:06 UTC

[sling-whiteboard] 03/03: clean up bugs and code smell

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 8c7aa8ef38de6e8a7f5cdcd41223cbfdc974db35
Author: Cris Rockwell <cm...@umich.edu>
AuthorDate: Wed May 6 18:18:38 2020 -0400

    clean up bugs and code smell
---
 .../apache/sling/auth/saml2/AuthenticationHandlerSAML2.java   | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/saml-handler/src/main/java/org/apache/sling/auth/saml2/AuthenticationHandlerSAML2.java b/saml-handler/src/main/java/org/apache/sling/auth/saml2/AuthenticationHandlerSAML2.java
index dd2e01a..3bd3432 100644
--- a/saml-handler/src/main/java/org/apache/sling/auth/saml2/AuthenticationHandlerSAML2.java
+++ b/saml-handler/src/main/java/org/apache/sling/auth/saml2/AuthenticationHandlerSAML2.java
@@ -525,15 +525,10 @@ public class AuthenticationHandlerSAML2 extends DefaultAuthenticationFeedbackHan
         // validate In Response To (ID saved in session from authnRequest)
         final String inResponseTo = subjectConfirmationData.getInResponseTo();
         final String savedInResponseTo = new SessionStorage(SAML2_REQUEST_ID).getString(req);
-        boolean validID = false;
-        if (savedInResponseTo != null && inResponseTo != null) {
-            validID = savedInResponseTo.equals(inResponseTo);
-        }
+        boolean validID = savedInResponseTo.equals(inResponseTo);
+
         // return true if subject confirmation is validated
-        if (validID && validRecipient && validID) {
-            return true;
-        }
-        return false;
+        return validTime && validRecipient && validID;
     }
 
     private void redirectToGotoURL(HttpServletRequest req, HttpServletResponse resp) {