[java-opensaml COMMIT] /trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/logic/DefaultLocalErr...

noreply at shibboleth.net noreply at shibboleth.net
Mon Jun 2 11:20:05 EDT 2014


Author: scantor
Date: Mon Jun  2 11:20:05 2014
New Revision: 3906

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3906&view=rev
Log:
Use response to handle errors when isPassive is set.

Modified:
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/logic/DefaultLocalErrorPredicate.java

Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/logic/DefaultLocalErrorPredicate.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/logic/DefaultLocalErrorPredicate.java?rev=3906&r1=3905&r2=3906&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/logic/DefaultLocalErrorPredicate.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/logic/DefaultLocalErrorPredicate.java Mon Jun  2 11:20:05 2014
@@ -27,16 +27,19 @@
 import org.opensaml.profile.context.EventContext;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.profile.context.navigate.CurrentOrPreviousEventLookupFunction;
+import org.opensaml.profile.context.navigate.InboundMessageContextLookup;
 import org.opensaml.profile.context.navigate.OutboundMessageContextLookup;
 import org.opensaml.saml.common.messaging.context.SAMLBindingContext;
 import org.opensaml.saml.common.messaging.context.SAMLEndpointContext;
 import org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext;
+import org.opensaml.saml.saml2.core.AuthnRequest;
 
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.messaging.context.navigate.MessageLookup;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -158,6 +161,13 @@
             return true;
         }
 
+        final AuthnRequest authnRequest = new MessageLookup<AuthnRequest>(AuthnRequest.class).apply(
+                new InboundMessageContextLookup().apply(input));
+        if (authnRequest != null && authnRequest.isPassive()) {
+            log.debug("Request was a SAML 2 AuthnRequest with IsPassive set, handling error with response");
+            return false;
+        }
+        
         final EventContext eventCtx = eventContextLookupStrategy.apply(input);
         if (eventCtx == null || eventCtx.getEvent() == null) {
             log.debug("No event found, assuming error handled with response");



More information about the commits mailing list