diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java index dbe616799237..f1c3df7acfc9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java @@ -136,10 +136,10 @@ void backOffIfOAuth2ResourceServerAutoConfigurationPresent() { void backOffIfSaml2RelyingPartyAutoConfigurationPresent() { this.contextRunner.withConfiguration(AutoConfigurations.of(Saml2RelyingPartyAutoConfiguration.class)) .withPropertyValues( - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.url=https://simplesaml-for-spring-saml/SSOService.php", - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.sign-request=false", - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.entity-id=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/metadata.php", - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.verification.credentials[0].certificate-location=classpath:saml/certificate-location") + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.url=https://simplesaml-for-spring-saml/SSOService.php", + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.sign-request=false", + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.entity-id=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/metadata.php", + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.verification.credentials[0].certificate-location=classpath:saml/certificate-location") .run((context) -> assertThat(context).doesNotHaveBean(ManagementWebSecurityAutoConfiguration.class) .doesNotHaveBean(MANAGEMENT_SECURITY_FILTER_CHAIN_BEAN)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java index 56ce6510aa95..29a866f56f83 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java @@ -68,11 +68,11 @@ public static class Registration { /** * Remote SAML Identity Provider. */ - private final AssertingParty assertingParty = new AssertingParty(); + private final AssertingParty assertingparty = new AssertingParty(); /** * Remote SAML Identity Provider. - * @deprecated use {@link #assertingParty} + * @deprecated use {@link #assertingparty} */ @Deprecated private final AssertingParty identityprovider = new AssertingParty(); @@ -97,14 +97,14 @@ public Decryption getDecryption() { return this.decryption; } - public AssertingParty getAssertingParty() { - return this.assertingParty; + public AssertingParty getAssertingparty() { + return this.assertingparty; } /** * Remote SAML Identity Provider. * @return remote SAML Identity Provider - * @deprecated use {@link #getAssertingParty()} + * @deprecated use {@link #getAssertingparty()} */ @Deprecated public AssertingParty getIdentityprovider() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java index 6b22cea867d0..6d09a917153c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java @@ -203,7 +203,7 @@ Boolean getSingleSignonSignRequest() { @SuppressWarnings("deprecation") private T get(String name, Function getter) { - T newValue = getter.apply(this.registration.getAssertingParty()); + T newValue = getter.apply(this.registration.getAssertingparty()); if (newValue != null) { return newValue; } @@ -211,7 +211,7 @@ private T get(String name, Function getter) { if (deprecatedValue != null) { logger.warn(LogMessage.format( "Property 'spring.security.saml2.relyingparty.registration.identityprovider.%1$s.%2$s' is deprecated, " - + "please use 'spring.security.saml2.relyingparty.registration.asserting-party.%1$s.%2$s' instead", + + "please use 'spring.security.saml2.relyingparty.registration.assertingparty.%1$s.%2$s' instead", this.id, name)); return deprecatedValue; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java index 8f908de316ed..0ea9f630754f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java @@ -186,7 +186,7 @@ void autoconfigurationShouldQueryAssertingPartyMetadataWhenMetadataUrlIsPresent( server.start(); String metadataUrl = server.url("").toString(); setupMockResponse(server, new ClassPathResource("saml/idp-metadata")); - this.contextRunner.withPropertyValues(PREFIX + ".foo.asserting-party.metadata-uri=" + metadataUrl) + this.contextRunner.withPropertyValues(PREFIX + ".foo.assertingparty.metadata-uri=" + metadataUrl) .run((context) -> { assertThat(context).hasSingleBean(RelyingPartyRegistrationRepository.class); assertThat(server.getRequestCount()).isEqualTo(1); @@ -215,7 +215,7 @@ void autoconfigurationShouldUseBindingFromMetadataUrlIfPresent() throws Exceptio server.start(); String metadataUrl = server.url("").toString(); setupMockResponse(server, new ClassPathResource("saml/idp-metadata")); - this.contextRunner.withPropertyValues(PREFIX + ".foo.asserting-party.metadata-uri=" + metadataUrl) + this.contextRunner.withPropertyValues(PREFIX + ".foo.assertingparty.metadata-uri=" + metadataUrl) .run((context) -> { RelyingPartyRegistrationRepository repository = context .getBean(RelyingPartyRegistrationRepository.class); @@ -250,8 +250,8 @@ void autoconfigurationWhenMetadataUrlAndPropertyPresentShouldUseBindingFromPrope server.start(); String metadataUrl = server.url("").toString(); setupMockResponse(server, new ClassPathResource("saml/idp-metadata")); - this.contextRunner.withPropertyValues(PREFIX + ".foo.asserting-party.metadata-uri=" + metadataUrl, - PREFIX + ".foo.asserting-party.singlesignon.binding=redirect").run((context) -> { + this.contextRunner.withPropertyValues(PREFIX + ".foo.assertingparty.metadata-uri=" + metadataUrl, + PREFIX + ".foo.assertingparty.singlesignon.binding=redirect").run((context) -> { RelyingPartyRegistrationRepository repository = context .getBean(RelyingPartyRegistrationRepository.class); RelyingPartyRegistration registration = repository.findByRegistrationId("foo"); @@ -378,7 +378,7 @@ void samlLoginShouldShouldBeConditionalOnSecurityWebFilterClassDeprecated() { } private String[] getPropertyValuesWithoutSigningCredentials(boolean signRequests, boolean useDeprecated) { - String assertingParty = useDeprecated ? "identityprovider" : "asserting-party"; + String assertingParty = useDeprecated ? "identityprovider" : "assertingparty"; return new String[] { PREFIX + ".foo." + assertingParty + ".singlesignon.url=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/SSOService.php", @@ -391,7 +391,7 @@ private String[] getPropertyValuesWithoutSigningCredentials(boolean signRequests } private String[] getPropertyValuesWithoutSsoBinding(boolean useDeprecated) { - String assertingParty = useDeprecated ? "identityprovider" : "asserting-party"; + String assertingParty = useDeprecated ? "identityprovider" : "assertingparty"; return new String[] { PREFIX + ".foo." + assertingParty + ".singlesignon.url=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/SSOService.php", @@ -403,7 +403,7 @@ private String[] getPropertyValuesWithoutSsoBinding(boolean useDeprecated) { } private String[] getPropertyValues(boolean useDeprecated) { - String assertingParty = useDeprecated ? "identityprovider" : "asserting-party"; + String assertingParty = useDeprecated ? "identityprovider" : "assertingparty"; return new String[] { PREFIX + ".foo.signing.credentials[0].private-key-location=classpath:saml/private-key-location", PREFIX + ".foo.signing.credentials[0].certificate-location=classpath:saml/certificate-location", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java index e395e7d63918..4788203026ed 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java @@ -41,26 +41,26 @@ class Saml2RelyingPartyPropertiesTests { @Test void customizeSsoUrl() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.url", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.url", "https://simplesaml-for-spring-saml/SSOService.php"); assertThat( - this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getSinglesignon().getUrl()) + this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getSinglesignon().getUrl()) .isEqualTo("https://simplesaml-for-spring-saml/SSOService.php"); } @Test void customizeSsoBinding() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.binding", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.binding", "post"); - assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getSinglesignon() + assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getSinglesignon() .getBinding()).isEqualTo(Saml2MessageBinding.POST); } @Test void customizeSsoSignRequests() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.sign-request", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.sign-request", "false"); - assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getSinglesignon() + assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getSinglesignon() .getSignRequest()).isEqualTo(false); } @@ -80,9 +80,9 @@ void customizeRelyingPartyEntityIdDefaultsToServiceProviderMetadata() { @Test void customizeAssertingPartyMetadataUri() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.metadata-uri", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.metadata-uri", "https://idp.example.org/metadata"); - assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getMetadataUri()) + assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getMetadataUri()) .isEqualTo("https://idp.example.org/metadata"); } diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc index c7c95443d173..e82be5518036 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc @@ -262,7 +262,7 @@ You can register multiple relying parties under the `spring.security.saml2.relyi credentials: - private-key-location: "path-to-private-key" certificate-location: "path-to-certificate" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "path-to-verification-cert" @@ -278,7 +278,7 @@ You can register multiple relying parties under the `spring.security.saml2.relyi credentials: - private-key-location: "path-to-private-key" certificate-location: "path-to-certificate" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "path-to-other-verification-cert" diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml index 83ac8e90b398..2f40f2db78ba 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: credentials: - private-key-location: "classpath:saml/privatekey.txt" certificate-location: "classpath:saml/certificate.txt" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "classpath:saml/certificate.txt" @@ -21,7 +21,7 @@ spring: credentials: - private-key-location: "classpath:saml/privatekey.txt" certificate-location: "classpath:saml/certificate.txt" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "classpath:saml/certificate.txt"