[java-plugin-shibd] 03/04: Add remoted request load/clear when checking flow conditions.
Codeberg
noreply at shibboleth.net
Thu Aug 6 18:34:23 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-plugin-shibd.
View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/eed17933964aa9944f3f3a904d3375ead020350c
commit eed17933964aa9944f3f3a904d3375ead020350c
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Thu Aug 6 14:33:01 2026 -0400
Add remoted request load/clear when checking flow conditions.
---
.../impl/SessionInitiatorFlowDescriptorManager.java | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/SessionInitiatorFlowDescriptorManager.java b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/SessionInitiatorFlowDescriptorManager.java
index 89ba78d..68e4c88 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/SessionInitiatorFlowDescriptorManager.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/SessionInitiatorFlowDescriptorManager.java
@@ -30,6 +30,8 @@ import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.spring.config.IdentifiedComponentManager;
+import net.shibboleth.sp.context.AgentRequestContext;
+import net.shibboleth.sp.messaging.RemotedHttpServletRequestResponseContext;
import net.shibboleth.sp.profile.SessionInitiatorFlowDescriptor;
/**
@@ -77,7 +79,23 @@ public class SessionInitiatorFlowDescriptorManager extends IdentifiedComponentMa
@Nullable final ProfileRequestContext profileRequestContext) {
final SessionInitiatorFlowDescriptor flow = sessionInitiatorMap.get(id);
if (flow != null) {
- final boolean active = flow.getActivationCondition().test(profileRequestContext);
+
+ final AgentRequestContext agentRequestContext = profileRequestContext != null
+ ? profileRequestContext.getSubcontext(AgentRequestContext.class) : null;
+
+ final boolean active;
+
+ // We do the crazy stuff to accomodate flow activation conditions evaluating the servlet request.
+ try {
+ if (agentRequestContext != null) {
+ RemotedHttpServletRequestResponseContext.loadCurrent(agentRequestContext.getRemotedHttpServletRequest(),
+ agentRequestContext.getRemotedHttpServletResponse());
+ }
+
+ active = flow.getActivationCondition().test(profileRequestContext);
+ } finally {
+ RemotedHttpServletRequestResponseContext.clearCurrent();
+ }
if (active) {
log.debug("Session initiator flow ({}) active, attempting", id);
} else {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list