Skip to content

Commit 095faff

Browse files
committed
Add RelyingPartyRegistration Preparation Steps
Issue gh-11077
1 parent 6b0ed02 commit 095faff

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

docs/modules/ROOT/pages/migration.adoc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,65 @@ Saml2AuthenticationToken(saml2Response, registration)
20152015
----
20162016
====
20172017

2018+
=== Use `RelyingPartyRegistration` updated methods
2019+
2020+
In an early release of Spring Security's SAML support, there was some ambiguity on the meaning of certain `RelyingPartyRegistration` methods and their function.
2021+
As more capabilities were added to `RelyingPartyRegistration`, it became necessary to clarify this ambiguity by changing method names to ones that aligned with spec language.
2022+
2023+
The deprecated methods in `RelyingPartyRegstration` are removed.
2024+
To prepare for that, consider the following representative usage of `RelyingPartyRegistration`:
2025+
2026+
====
2027+
.Java
2028+
[source,java,role="primary"]
2029+
----
2030+
String idpEntityId = registration.getRemoteIdpEntityId();
2031+
String assertionConsumerServiceUrl = registration.getAssertionConsumerServiceUrlTemplate();
2032+
String idpWebSsoUrl = registration.getIdpWebSsoUrl();
2033+
String localEntityId = registration.getLocalEntityIdTemplate();
2034+
List<Saml2X509Credential> verifying = registration.getCredentials().stream()
2035+
.filter(Saml2X509Credential::isSignatureVerficationCredential)
2036+
.collect(Collectors.toList());
2037+
----
2038+
2039+
.Kotlin
2040+
[source,kotlin,role="secondary"]
2041+
----
2042+
val idpEntityId: String = registration.getRemoteIdpEntityId()
2043+
val assertionConsumerServiceUrl: String = registration.getAssertionConsumerServiceUrlTemplate()
2044+
val idpWebSsoUrl: String = registration.getIdpWebSsoUrl()
2045+
val localEntityId: String = registration.getLocalEntityIdTemplate()
2046+
val verifying: List<Saml2X509Credential> = registration.getCredentials()
2047+
.filter(Saml2X509Credential::isSignatureVerficationCredential)
2048+
----
2049+
====
2050+
2051+
This should change to:
2052+
2053+
====
2054+
.Java
2055+
[source,java,role="primary"]
2056+
----
2057+
String assertingPartyEntityId = registration.getAssertingPartyDetails().getEntityId();
2058+
String assertionConsumerServiceLocation = registration.getAssertionConsumerServiceLocation();
2059+
String singleSignOnServiceLocation = registration.getAssertingPartyDetails().getSingleSignOnServiceLocation();
2060+
String entityId = registration.getEntityId();
2061+
List<Saml2X509Credential> verifying = registration.getAssertingPartyDetails().getVerificationX509Credentials();
2062+
----
2063+
2064+
.Kotlin
2065+
[source,kotlin,role="secondary"]
2066+
----
2067+
val assertingPartyEntityId: String = registration.getAssertingPartyDetails().getEntityId()
2068+
val assertionConsumerServiceLocation: String = registration.getAssertionConsumerServiceLocation()
2069+
val singleSignOnServiceLocation: String = registration.getAssertingPartyDetails().getSingleSignOnServiceLocation()
2070+
val entityId: String = registration.getEntityId()
2071+
val verifying: List<Saml2X509Credential> = registration.getAssertingPartyDetails().getVerificationX509Credentials()
2072+
----
2073+
====
2074+
2075+
For a complete listing of all changed methods, please see {security-api-url}org/springframework/security/saml2/provider/service/registration/RelyingPartyRegistration.html[``RelyingPartyRegistration``'s JavaDoc].
2076+
20182077
== Reactive
20192078

20202079
=== Use `AuthorizationManager` for Method Security

0 commit comments

Comments
 (0)