You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Stop using Converter constructors
- Replace Saml2AuthenticationRequestContextResolver and
Saml2AuthenticationRequestFactory with
Saml2AuthenticationRequestResolver
Issue gh-11077
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration.adoc
+109
Original file line number
Diff line number
Diff line change
@@ -1864,6 +1864,115 @@ public class SecurityConfig {
1864
1864
----
1865
1865
====
1866
1866
1867
+
=== Stop Using SAML 2.0 `Converter` constructors
1868
+
1869
+
In an early release of Spring Security's SAML 2.0 support, `Saml2MetadataFilter` and `Saml2AuthenticationTokenConverter` shipped with constructors of type `Converter`.
1870
+
This level of abstraction made it tricky to evolve the class and so a dedicated interface `RelyingPartyRegistrationResolver` was introduced in a later release.
1871
+
1872
+
In 6.0, the `Converter` constructors are removed.
1873
+
To prepare for this in 5.8, change classes that implement `Converter<HttpServletRequest, RelyingPartyRegistration>` to instead implement `RelyingPartyRegistrationResolver`.
1874
+
1875
+
=== Change to Using `Saml2AuthenticationRequestResolver`
1876
+
1877
+
`Saml2AuthenticationContextResolver` and `Saml2AuthenticationRequestFactory` are removed in 6.0 as is the `Saml2WebSsoAuthenticationRequestFilter` that requires them.
1878
+
They are replaced by `Saml2AuthenticationRequestResolver` and a new constructor in `Saml2WebSsoAuthenticationRequestFilter`.
1879
+
The new interface removes an unnecessary transport object between the two classes.
1880
+
1881
+
Most applications need do nothing; however, if you use or configure `Saml2AuthenticationRequestContextResolver` or `Saml2AuthenticationRequestFactory`, try the following steps to convert instead use `Saml2AuthenticationRequestResolver`.
1882
+
1883
+
==== Use `setAuthnRequestCustomizer` instead of `setAuthenticationRequestContextConverter`
1884
+
1885
+
If you are calling `OpenSaml4AuthenticationReqeustFactory#setAuthenticationRequestContextConverter`, for example, like so:
Also, since `setAuthnRequestCustomizer` has direct access to the `HttpServletRequest`, there is no need for a `Saml2AuthenticationRequestContextResolver`.
1936
+
Simply use `setAuthnRequestCustomizer` to read directly from `HttpServletRequest` this information you need.
1937
+
1938
+
==== Use `setAuthnRequestCustomizer` instead of `setProtocolBinding`
Since Spring Security only supports the `POST` binding for authentication, there is not very much value in overriding the protocol binding at this point in time.
1974
+
====
1975
+
1867
1976
== Reactive
1868
1977
1869
1978
=== Use `AuthorizationManager` for Method Security
0 commit comments