diff --git a/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRelyingPartyRegistrationRepository.java b/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRelyingPartyRegistrationRepository.java index ca6ce829729..0d757ebefde 100644 --- a/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRelyingPartyRegistrationRepository.java +++ b/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRelyingPartyRegistrationRepository.java @@ -1,6 +1,8 @@ package org.cloudfoundry.identity.uaa.provider.saml; import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.security.saml2.provider.service.registration.InMemoryRelyingPartyRegistrationRepository; import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration; @@ -20,10 +22,20 @@ public class SamlRelyingPartyRegistrationRepository { // SP metadata generation. See relevant issue: https://github.com/spring-projects/spring-security/issues/11369 public static final String CLASSPATH_DUMMY_SAML_IDP_METADATA_XML = "classpath:dummy-saml-idp-metadata.xml"; + @Autowired + @Qualifier("samlEntityID") + private String samlEntityID; + + @Autowired + @Qualifier("samlSpNameID") + private String samlSpNameID; + @Bean RelyingPartyRegistrationRepository relyingPartyRegistrationRepository() { RelyingPartyRegistration relyingPartyRegistration = RelyingPartyRegistrations .fromMetadataLocation(CLASSPATH_DUMMY_SAML_IDP_METADATA_XML) + .entityId(samlEntityID) + .nameIdFormat(samlSpNameID) .registrationId("example") .build(); return new InMemoryRelyingPartyRegistrationRepository(relyingPartyRegistration); diff --git a/uaa/src/main/webapp/WEB-INF/spring/saml-providers.xml b/uaa/src/main/webapp/WEB-INF/spring/saml-providers.xml index 093ea0c8802..857d6976e2b 100644 --- a/uaa/src/main/webapp/WEB-INF/spring/saml-providers.xml +++ b/uaa/src/main/webapp/WEB-INF/spring/saml-providers.xml @@ -61,6 +61,10 @@ + + + +