[java-plugin-shibd] branch main updated: Return a candidate session ID from token consumer flow.
Codeberg
noreply at shibboleth.net
Wed Sep 16 16:27:03 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/e9ddddf4cc7a23f08523790fe9f1f06cab1f32ee
The following commit(s) were added to refs/heads/main by this push:
new e9ddddf Return a candidate session ID from token consumer flow.
e9ddddf is described below
commit e9ddddf4cc7a23f08523790fe9f1f06cab1f32ee
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Wed Sep 16 12:26:53 2026 -0400
Return a candidate session ID from token consumer flow.
---
.../sp/profile/AbstractTokenConsumerResponseAction.java | 14 ++++++++++++++
.../java/net/shibboleth/sp/profile/ConsumerConstants.java | 5 ++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java b/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
index 30d6961..8da8fba 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
+++ b/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
@@ -33,10 +33,13 @@ import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.context.AttributeContext;
+import net.shibboleth.profile.config.navigate.IdentifierGenerationStrategyLookupFunction;
+import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
import net.shibboleth.shared.codec.Base64Support;
import net.shibboleth.shared.codec.EncodingException;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.shared.security.IdentifierGenerationStrategy;
import net.shibboleth.sp.context.AgentRequestContext;
import net.shibboleth.sp.context.StateDataContext;
import net.shibboleth.sp.ddf.DDF;
@@ -79,10 +82,15 @@ public abstract class AbstractTokenConsumerResponseAction extends AbstractApplic
/** Strategy used to locate the {@link StateDataContext} to pull target from. */
@Nonnull private Function<ProfileRequestContext,StateDataContext> stateDataContextLookupStrategy;
+ /** Strategy used to locate the {@link IdentifierGenerationStrategy} to use. */
+ @Nonnull private Function<ProfileRequestContext,IdentifierGenerationStrategy> idGeneratorLookupStrategy;
+
/** Constructor. */
public AbstractTokenConsumerResponseAction() {
attributeContextLookupStrategy = new ChildContextLookup<>(AttributeContext.class);
stateDataContextLookupStrategy = new ChildContextLookup<>(StateDataContext.class);
+ // Default strategy is to pull from profile's SecurityConfiguration.
+ idGeneratorLookupStrategy = new IdentifierGenerationStrategyLookupFunction();
}
/**
@@ -181,6 +189,12 @@ public abstract class AbstractTokenConsumerResponseAction extends AbstractApplic
output.addmember(ConsumerConstants.SESSION_NOTONORAFTER).longinteger(overrideExp.getEpochSecond());
}
+ // If possible, attach a random string to use as a session ID to aid Agent.
+ final IdentifierGenerationStrategy generator = idGeneratorLookupStrategy.apply(profileRequestContext);
+ if (generator != null) {
+ output.addmember(ConsumerConstants.RANDOM).string(generator.generateIdentifier(false));
+ }
+
final RemotedHttpServletResponse remotedResponse = agentRequestContext.getRemotedHttpServletResponse();
assert remotedResponse != null;
diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/profile/ConsumerConstants.java b/sp-server-api/src/main/java/net/shibboleth/sp/profile/ConsumerConstants.java
index b3fb1bc..c8974e7 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/profile/ConsumerConstants.java
+++ b/sp-server-api/src/main/java/net/shibboleth/sp/profile/ConsumerConstants.java
@@ -28,7 +28,10 @@ public final class ConsumerConstants {
/** Token validation errors data member. */
@Nonnull @NotEmpty public static final String VALIDATION_ERRORS = "validation_errors";
-
+
+ /** Random session ID data member. */
+ @Nonnull @NotEmpty public static final String RANDOM = "random";
+
/** Opaque session data member. */
@Nonnull @NotEmpty public static final String SESSION_OPAQUE = "session.opaque";
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list