[java-plugin-shibd] branch main updated: Add side effect to stash off state token.

Scott Cantor cantor.2 at osu.edu
Tue Sep 30 21:27:10 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-plugin-shibd.

View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd.git;a=commit;h=ea00ccd7f76877036c6a388061ca3d0476c663e8

The following commit(s) were added to refs/heads/main by this push:
     new ea00ccd  Add side effect to stash off state token.
ea00ccd is described below

commit ea00ccd7f76877036c6a388061ca3d0476c663e8
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Sep 30 17:27:08 2025 -0400

    Add side effect to stash off state token.
---
 .../sp/profile/impl/MapStateTokenToResource.java       | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/MapStateTokenToResource.java b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/MapStateTokenToResource.java
index 408fb4f..233ae33 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/MapStateTokenToResource.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/MapStateTokenToResource.java
@@ -28,8 +28,10 @@ import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.sp.context.AgentRequestContext;
+import net.shibboleth.sp.ddf.DDF;
 import net.shibboleth.sp.messaging.RemotedHttpServletRequestResponseContext;
 import net.shibboleth.sp.profile.AbstractApplicationAction;
+import net.shibboleth.sp.profile.SPConstants;
 
 /**
  * Action that maps a state token into a target/resource URL.
@@ -39,6 +41,9 @@ import net.shibboleth.sp.profile.AbstractApplicationAction;
  * <p>The existence of {@link AgentRequestContext#getTargetURL()} will cause the action
  * to be skipped but the absence of a state token will not result in failure.</p>
  * 
+ * <p>As a side effect for downstream actions, the state token will be added to the
+ * input message in a {@link SPConstants#STATE} field.</p>
+ * 
  * @event {@link EventIds#PROCEED_EVENT_ID}
  * @event {@link EventIds#INVALID_MESSAGE}
  * @event {@link EventIds#IO_ERROR}
@@ -104,10 +109,19 @@ public class MapStateTokenToResource extends AbstractApplicationAction {
                 return;
             }
             
+            final DDF input = agentRequestContext.getInput();
+            if (input != null) {
+                input.addmember(SPConstants.STATE).string(token);
+            }
+            
             final byte[] target = ensureApplication().getStateTokenManager().recoverFromStateToken(
                     ensureAgent(), ensureApplication(), token);
-            agentRequestContext.setTargetURL(target);
-            log.debug("{} Requested resource recovered from state token: {}", getLogPrefix(), target);
+            if (target != null) {
+                agentRequestContext.setTargetURL(target);
+                log.debug("{} Requested resource recovered from state token: {}", getLogPrefix(), target);
+            } else {
+                log.warn("{} Unable to recover requested resource from state token", getLogPrefix());
+            }
         } catch (final IOException e) {
             log.warn("{} Exception recovering requested resource from state token", getLogPrefix(), e);
         } finally {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list