[java-plugin-shibd-saml] branch main updated: Initial testing fixes for SAML consumer flow.
Scott Cantor
cantor.2 at osu.edu
Tue Oct 1 20:55:09 UTC 2024
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-plugin-shibd-saml.
View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd-saml.git;a=commit;h=6c6a6c53c61532c6de67d26222161e6e6085356a
The following commit(s) were added to refs/heads/main by this push:
new 6c6a6c5 Initial testing fixes for SAML consumer flow.
6c6a6c5 is described below
commit 6c6a6c53c61532c6de67d26222161e6e6085356a
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Oct 1 16:55:06 2024 -0400
Initial testing fixes for SAML consumer flow.
---
sp-saml-conf-impl/pom.xml | 6 +
.../META-INF/net.shibboleth.idp/postconfig.xml | 5 +-
.../sp/consumer/saml2/artifact/artifact-flow.xml | 2 +-
.../saml2/post-simplesign/post-simplesign-flow.xml | 2 +-
.../idp/flows/sp/consumer/saml2/post/post-flow.xml | 2 +-
.../idp/flows/sp/consumer/saml2/saml2-beans.xml | 5 +-
.../idp/flows/sp/consumer/saml2/saml2-flow.xml | 2 +-
.../saml2-abstract-beans.xml | 0
.../saml2-abstract-flow.xml | 2 +-
.../flows/saml2/SAML2SessionInitiatorFlowTest.java | 3 +-
.../flows/saml2/SAML2TokenConsumerFlowTest.java | 210 +++++++++++++++++++++
...MLEnvironmentApplicationContextInitializer.java | 1 +
.../net/shibboleth/sp/saml-test-beans.xml | 11 ++
13 files changed, 242 insertions(+), 9 deletions(-)
diff --git a/sp-saml-conf-impl/pom.xml b/sp-saml-conf-impl/pom.xml
index 0fd61a4..41766ee 100644
--- a/sp-saml-conf-impl/pom.xml
+++ b/sp-saml-conf-impl/pom.xml
@@ -189,6 +189,12 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-testing</artifactId>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>${shib-shared.groupId}</groupId>
<artifactId>shib-testing</artifactId>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
index 1a0e10e..7888966 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -12,12 +12,13 @@
http://www.springframework.org/schema/integration/ip https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd"
default-init-method="initialize" default-destroy-method="destroy">
-
+
<!-- Token consumer descriptors for each SAML binding. -->
<bean p:id="sp/consumer/saml2/post" class="net.shibboleth.sp.profile.BasicTokenConsumerFlowDescriptor">
<property name="activationCondition">
<bean class="net.shibboleth.sp.profile.context.logic.HttpSeevletRequestPredicate"
+ p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier"
p:allowedMethods="POST"
p:allowedContentTypes="application/x-www-form-urlencoded"
p:requiredParameters="SAMLResponse" />
@@ -27,6 +28,7 @@
<bean p:id="sp/consumer/saml2/post-simplesign" class="net.shibboleth.sp.profile.BasicTokenConsumerFlowDescriptor">
<property name="activationCondition">
<bean class="net.shibboleth.sp.profile.context.logic.HttpSeevletRequestPredicate"
+ p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier"
p:allowedMethods="POST"
p:allowedContentTypes="application/x-www-form-urlencoded"
p:requiredParameters="#{{ 'SAMLResponse', 'Signature' }}" />
@@ -36,6 +38,7 @@
<bean p:id="sp/consumer/saml2/artifact" class="net.shibboleth.sp.profile.BasicTokenConsumerFlowDescriptor">
<property name="activationCondition">
<bean class="net.shibboleth.sp.profile.context.logic.HttpSeevletRequestPredicate"
+ p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier"
p:allowedMethods="#{{ 'GET', 'POST' }}"
p:allowedContentTypes="application/x-www-form-urlencoded"
p:allowNullContentType="true"
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-flow.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-flow.xml
index e63c001..faff5ef 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-flow.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-flow.xml
@@ -4,6 +4,6 @@
parent="sp/consumer/saml2">
<!-- The file really exists in this directory, but it's referenced from extending flow-directories -->
- <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-artifact-beans.xml" />
+ <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/artifact/artifact-beans.xml" />
</flow>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-flow.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-flow.xml
index 2684446..d44064f 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-flow.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-flow.xml
@@ -4,6 +4,6 @@
parent="sp/consumer/saml2-abstract">
<!-- The file really exists in this directory, but it's referenced from extending flow-directories -->
- <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-post-simplesign-beans.xml" />
+ <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post-simplesign/post-simplesign-beans.xml" />
</flow>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-flow.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-flow.xml
index ab811fc..92e557f 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-flow.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-flow.xml
@@ -4,6 +4,6 @@
parent="sp/consumer/saml2">
<!-- The file really exists in this directory, but it's referenced from extending flow-directories -->
- <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-post-beans.xml" />
+ <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/post/post-beans.xml" />
</flow>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
index 90fa982..f1b0f51 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
@@ -38,6 +38,7 @@
<bean class="org.opensaml.saml.common.binding.security.impl.MessageLifetimeSecurityHandler" scope="prototype"
p:messageLifetime="%{sp.policy.messageLifetime:PT3M}"
p:clockSkew="%{sp.policy.clockSkew:PT3M}" />
+ <bean class="org.opensaml.saml.common.binding.impl.CheckMessageStatusHandler" scope="prototype" />
<bean class="org.opensaml.saml.common.binding.security.impl.SAMLProtocolMessageXMLSignatureSecurityHandler" scope="prototype" />
<bean class="org.opensaml.saml.saml2.binding.security.impl.SAML2HTTPPostSimpleSignSecurityHandler" scope="prototype"
p:httpServletRequestSupplier-ref="shibboleth.RemotedHttpServletRequestSupplier"
@@ -150,7 +151,7 @@
<property name="responseResolver">
<bean parent="shibboleth.Functions.Compose">
<constructor-arg name="g">
- <beanclass="org.opensaml.messaging.context.navigate.MessageLookup"
+ <bean class="org.opensaml.messaging.context.navigate.MessageLookup"
c:type="#{ T(org.opensaml.saml.saml2.core.Response) }" />
</constructor-arg>
<constructor-arg name="f">
@@ -168,7 +169,7 @@
p:authnContextDeclRefAttributeId="%{sp.saml.authnContextDeclRefAttributeId:}"
p:sessionIndexAttributeId="%{sp.saml.sessionIndexAttributeId:}"
p:consentAttributeId="%{sp.saml.consentAttributeId:}"
- p:authorityAttributeId="%{sp.saml.authorityAttributeId:}"
+ p:authenticatingAuthorityAttributeId="%{sp.saml.authorityAttributeId:}"
p:notBeforeAttributeId="%{sp.saml.notBeforeAttributeId:}"
p:notOnOrAfterAttributeId="%{sp.saml.notOnOrAfterAttributeId:}"
p:sessionNotOnOrAfterAttributeId="%{sp.saml.sessionNotOnOrAfterAttributeId:}"
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml
index 44d4e08..df00ef7 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml
@@ -32,6 +32,6 @@
</action-state>
<!-- The file really exists in this directory, but it's referenced from extending flow-directories -->
- <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-abstract-beans.xml" />
+ <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml" />
</flow>
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2/saml2-abstract-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2-abstract/saml2-abstract-beans.xml
similarity index 100%
rename from sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2/saml2-abstract-beans.xml
rename to sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2-abstract/saml2-abstract-beans.xml
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2/saml2-abstract-flow.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2-abstract/saml2-abstract-flow.xml
similarity index 96%
rename from sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2/saml2-abstract-flow.xml
rename to sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2-abstract/saml2-abstract-flow.xml
index b946d22..62502bf 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2/saml2-abstract-flow.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/saml2-abstract/saml2-abstract-flow.xml
@@ -28,6 +28,6 @@
</action-state>
<!-- The file really exists in this directory, but it's referenced from extending flow-directories -->
- <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/saml2/saml2-abstract-beans.xml" />
+ <bean-import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/saml2-abstract/saml2-abstract-beans.xml" />
</flow>
diff --git a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java
index fdf59ff..5005cb2 100644
--- a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java
+++ b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2SessionInitiatorFlowTest.java
@@ -69,9 +69,10 @@ public class SAML2SessionInitiatorFlowTest extends AbstractSPFlowTest {
/** Flow ID. */
@Nonnull public static final String FLOW_ID = "sp/session-initiator";
- /** Flow ID. */
+ /** ACS URL. */
@Nonnull public static final String RESPONSE_URL = "https://sp.example.org/Shibboleth.sso/SAML2/POST";
+ /** Constructor. */
protected SAML2SessionInitiatorFlowTest() {
super(FLOW_ID);
}
diff --git a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2TokenConsumerFlowTest.java b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2TokenConsumerFlowTest.java
new file mode 100644
index 0000000..e581a51
--- /dev/null
+++ b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/SAML2TokenConsumerFlowTest.java
@@ -0,0 +1,210 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.sp.saml.flows.saml2;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.util.XMLObjectSupport;
+import org.opensaml.profile.action.EventIds;
+import org.opensaml.profile.context.ProfileRequestContext;
+import org.opensaml.saml.saml2.core.Assertion;
+import org.opensaml.saml.saml2.core.Response;
+import org.opensaml.saml.saml2.core.StatusCode;
+import org.opensaml.saml.saml2.testing.SAML2ActionTestingSupport;
+import org.opensaml.security.credential.Credential;
+import org.opensaml.storage.StorageService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.webflow.executor.FlowExecutionResult;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import net.shibboleth.idp.authn.AuthnEventIds;
+import net.shibboleth.shared.codec.Base64Support;
+import net.shibboleth.shared.codec.EncodingException;
+import net.shibboleth.shared.collection.CollectionSupport;
+import net.shibboleth.shared.collection.Pair;
+import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.net.URISupport;
+import net.shibboleth.sp.context.AgentRequestContext;
+import net.shibboleth.sp.ddf.DDF;
+import net.shibboleth.sp.flows.AbstractSPFlowTest;
+import net.shibboleth.sp.impl.StorageServiceStateTokenManager;
+import net.shibboleth.sp.messaging.RemotedHttpServletRequest;
+import net.shibboleth.sp.messaging.RemotedHttpServletResponse;
+
+/**
+ * Unit test for the SP session-initiator flow.
+ */
+ at ContextConfiguration(
+ locations = {
+ "classpath:/net/shibboleth/sp/saml-test-beans.xml", },
+ initializers = {
+ TestSPSAMLEnvironmentApplicationContextInitializer.class,
+ }
+ )
+ at WebAppConfiguration
+public class SAML2TokenConsumerFlowTest extends AbstractSPFlowTest {
+
+ /** Flow ID. */
+ @Nonnull public static final String FLOW_ID = "sp/token-consumer";
+
+ /** Issuer. */
+ @Nonnull public static final String ISSUER = "https://idp.example.org";
+
+ /** ACS URL. */
+ @Nonnull public static final String RESPONSE_URL = "https://sp.example.org/Shibboleth.sso/SAML2/POST";
+
+ @Autowired
+ @Qualifier("shibboleth.StorageService")
+ protected StorageService storageService;
+
+ /** Relay state manager. */
+ private StorageServiceStateTokenManager stateManager;
+
+ /** Dummy signing key. */
+ @Autowired @Qualifier("dummy.idp.Credential") protected Credential idpCredential;
+
+ /** Constructor. */
+ public SAML2TokenConsumerFlowTest() {
+ super(FLOW_ID);
+ }
+
+ /**
+ * Global state setup.
+ *
+ * @throws ComponentInitializationException
+ */
+ @BeforeClass
+ public void beforeClass() throws ComponentInitializationException {
+ stateManager = new StorageServiceStateTokenManager();
+ stateManager.setId("test");
+ stateManager.setStorageService(storageService);
+ stateManager.initialize();
+ }
+
+ /**
+ * Test flow without proper input.
+ *
+ * @throws IOException
+ */
+ @Test
+ public void testNoInput() throws IOException {
+ setDefaultAuth();
+
+ setApplicationRequest(APPLICATION_ID, null);
+
+ final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
+ assertFlowExecutionResult(result, FLOW_ID);
+ assertFlowExecutionOutcome(result.getOutcome());
+ assertOutputMessageEvent(result, AuthnEventIds.NO_POTENTIAL_FLOW);
+ }
+
+ /**
+ * Test flow with unverified (no metadata) IdP specified.
+ *
+ * @throws IOException
+ */
+ @Test
+ public void testUnverified() throws IOException {
+ setDefaultAuth();
+
+ final DDF input = buildRemotedPOSTResponse("https://unknown.example.org", StatusCode.SUCCESS);
+ setApplicationRequest(APPLICATION_ID, input);
+
+ final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
+ assertFlowExecutionResult(result, FLOW_ID);
+ assertFlowExecutionOutcome(result.getOutcome());
+ assertOutputMessageEvent(result, EventIds.INVALID_MESSAGE);
+ }
+
+ /**
+ * Decode an encoded response and run sanity checks against it.
+ *
+ * @param result flow execution result
+ * @param resource resource URL used in final redirect
+ *
+ * @return the output object
+ */
+ @Nonnull private DDF validateOutputMessage(@Nonnull final FlowExecutionResult result, @Nullable final String resource) {
+ final ProfileRequestContext prc = retrieveProfileRequestContext(result);
+ assert prc != null;
+ final AgentRequestContext arc = prc.ensureSubcontext(AgentRequestContext.class);
+ final DDF output = arc.getOutput();
+
+ assert output != null;
+ Assert.assertTrue(output.isstruct());
+ final DDF http = output.getmember(RemotedHttpServletRequest.STRUCTURE_NAME);
+ Assert.assertTrue(http.isstruct());
+
+ final String redirect = http.getmember(RemotedHttpServletResponse.REDIRECT).string();
+ Assert.assertEquals(resource, redirect);
+
+ return output;
+ }
+
+ /**
+ * Builds a SAML response as encoded into a form POST embedded in a remoted message.
+ *
+ * @param code status code string
+ *
+ * @return input object suitable for token consumer flow
+ * @throws IOException
+ */
+ @Nonnull private DDF buildRemotedPOSTResponse(@Nonnull final String issuer,
+ @Nonnull final String code) throws IOException {
+
+ final Response response = SAML2ActionTestingSupport.buildResponse();
+ response.setDestination(RESPONSE_URL);
+ response.setIssuer(SAML2ActionTestingSupport.buildIssuer(issuer));
+ response.setStatus(SAML2ActionTestingSupport.buildStatus(code, null));
+
+ if (StatusCode.SUCCESS.equals(code)) {
+ final Assertion assertion = SAML2ActionTestingSupport.buildAssertion();
+ response.getAssertions().add(assertion);
+ }
+
+ try (final ByteArrayOutputStream sink = new ByteArrayOutputStream()) {
+ XMLObjectSupport.marshallToOutputStream(response, sink);
+ final String base64 = Base64Support.encode(sink.toByteArray(), true);
+ final DDF obj = new DDF(null).structure();
+ final DDF http = obj.addmember(RemotedHttpServletRequest.STRUCTURE_NAME).structure();
+
+ http.addmember(RemotedHttpServletRequest.METHOD).string("POST");
+ http.addmember(RemotedHttpServletRequest.CONTENT_TYPE).string("application/x-www-form-urlencoded");
+ http.addmember(RemotedHttpServletRequest.REQUEST_URL).unsafe_string(RESPONSE_URL.getBytes(StandardCharsets.UTF_8));
+
+ http.addmember(RemotedHttpServletRequest.BODY).string(URISupport.buildQuery(
+ CollectionSupport.listOf(
+ new Pair<>("SAMLResponse", base64))
+ )
+ );
+
+ return obj;
+ } catch (final MarshallingException | EncodingException e) {
+ throw new IOException(e);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java
index adb0906..79246d6 100644
--- a/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java
+++ b/sp-saml-conf-impl/src/test/java/net/shibboleth/sp/saml/flows/saml2/TestSPSAMLEnvironmentApplicationContextInitializer.java
@@ -46,6 +46,7 @@ public class TestSPSAMLEnvironmentApplicationContextInitializer
mock.setProperty("idp.service.metadata.resources", "test.sp.saml.MetadataResolverResources");
mock.setProperty("sp.service.agents.resources", "test.sp.saml.AgentResolverResources");
mock.setProperty("sp.application.sessionInitiators", "saml2");
+ mock.setProperty("sp.application.tokenConsumers", "saml2/artifact, saml2/post, saml2/post-simplesign");
mock.setProperty("idp.additionalProperties",
"/conf/ldap.properties, /conf/saml-nameid.properties, /conf/services.properties, /conf/admin/admin.properties, /conf/authn/authn.properties, /conf/c14n/subject-c14n.properties, /credentials/secrets.properties, /conf/sp/sp.properties, /conf/sp/saml.properties");
applicationContext.getEnvironment().getPropertySources().addFirst(mock);
diff --git a/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml b/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml
index b2b73b4..f9211a2 100644
--- a/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml
+++ b/sp-saml-conf-impl/src/test/resources/net/shibboleth/sp/saml-test-beans.xml
@@ -24,4 +24,15 @@
<value>%{idp.home}/conf/sp/metadata-providers.xml</value>
</util:list>
+ <bean id="dummy.idp.X509Certificate" class="net.shibboleth.shared.spring.security.factory.X509CertificateFactoryBean"
+ p:resource="%{idp.home}/credentials/idp-signing.crt" />
+
+ <bean id="dummy.idp.PrivateKey" class="net.shibboleth.shared.spring.security.factory.PrivateKeyFactoryBean"
+ p:resource="%{idp.home}/credentials/idp-signing.key" />
+
+ <bean id="dummy.idp.Credential" class="org.opensaml.security.x509.BasicX509Credential"
+ c:entityCertificate-ref="dummy.idp.X509Certificate"
+ c:privateKey-ref="dummy.idp.PrivateKey"
+ p:entityId="https://idp.example.org" />
+
</beans>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list