Skip to content

Commit d3b143d

Browse files
committed
Move SAML 2.0 Migration Step
Issue gh-17099
1 parent 60c42e3 commit d3b143d

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

docs/modules/ROOT/pages/migration/servlet/oauth2.adoc

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -79,43 +79,6 @@ fun jwtDecoder(): JwtDecoder {
7979
<1> - `validateTypes` now defaults to `false`
8080
<2> - `JwtTypeValidator#jwt` is added by all `createDefaultXXX` methods
8181

82-
== Do Not Process `<saml2:Response>` GET Requests with `Saml2AuthenticationTokenConverter`
83-
84-
Spring Security does not support processing `<saml2:Response>` payloads over GET as this is not supported by the SAML 2.0 spec.
85-
86-
To better comply with this, `Saml2AuthenticationTokenConverter` and `OpenSaml5AuthenticationTokenConverter` will not process GET requests by default as of Spring Security 8.
87-
To prepare for this, the property `shouldConvertGetRequests` is available.
88-
To use it, publish your own converter like so:
89-
90-
[tabs]
91-
======
92-
Java::
93-
+
94-
[source,java,role="primary"]
95-
----
96-
@Bean
97-
OpenSaml5AuthenticationTokenConverter authenticationConverter(RelyingPartyRegistrationRepository registrations) {
98-
OpenSaml5AuthenticationTokenConverter authenticationConverter = new OpenSaml5AuthenticationTokenConverter(registrations);
99-
authenticationConverter.setShouldConvertGetRequests(false);
100-
return authenticationConverter;
101-
}
102-
----
103-
104-
Kotlin::
105-
+
106-
[source,kotlin,role="secondary"]
107-
----
108-
@Bean
109-
fun authenticationConverter(val registrations: RelyingPartyRegistrationRepository): Saml2AuthenticationTokenConverter {
110-
val authenticationConverter = Saml2AuthenticationTokenConverter(registrations)
111-
authenticationConverter.setShouldConvertGetRequests(false)
112-
return authenticationConverter
113-
}
114-
----
115-
======
116-
117-
If you must continue using `Saml2AuthenticationTokenConverter` or `OpenSaml5AuthenticationTokenConverter` to process GET requests, you can call `setShouldConvertGetRequests` to `true.`
118-
11982
== Provide an AuthenticationConverter to BearerTokenAuthenticationFilter
12083

12184
In Spring Security 7, `BearerTokenAuthenticationFilter#setBearerTokenResolver` and `#setAuthenticaionDetailsSource` are deprecated in favor of configuring those on `BearerTokenAuthenticationConverter`.

docs/modules/ROOT/pages/migration/servlet/saml2.adoc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,40 @@ fun authenticationProvider(): OpenSaml5AuthenticationProvider {
108108
======
109109

110110
If you are constructing a `Saml2Authentication` instance yourself, consider changing to `Saml2AssertionAuthentication` to get the same benefit as the current default.
111+
112+
== Do Not Process `<saml2:Response>` GET Requests with `Saml2AuthenticationTokenConverter`
113+
114+
Spring Security does not support processing `<saml2:Response>` payloads over GET as this is not supported by the SAML 2.0 spec.
115+
116+
To better comply with this, `Saml2AuthenticationTokenConverter` and `OpenSaml5AuthenticationTokenConverter` will not process GET requests by default as of Spring Security 8.
117+
To prepare for this, the property `shouldConvertGetRequests` is available.
118+
To use it, publish your own converter like so:
119+
120+
[tabs]
121+
======
122+
Java::
123+
+
124+
[source,java,role="primary"]
125+
----
126+
@Bean
127+
OpenSaml5AuthenticationTokenConverter authenticationConverter(RelyingPartyRegistrationRepository registrations) {
128+
OpenSaml5AuthenticationTokenConverter authenticationConverter = new OpenSaml5AuthenticationTokenConverter(registrations);
129+
authenticationConverter.setShouldConvertGetRequests(false);
130+
return authenticationConverter;
131+
}
132+
----
133+
134+
Kotlin::
135+
+
136+
[source,kotlin,role="secondary"]
137+
----
138+
@Bean
139+
fun authenticationConverter(val registrations: RelyingPartyRegistrationRepository): Saml2AuthenticationTokenConverter {
140+
val authenticationConverter = Saml2AuthenticationTokenConverter(registrations)
141+
authenticationConverter.setShouldConvertGetRequests(false)
142+
return authenticationConverter
143+
}
144+
----
145+
======
146+
147+
If you must continue using `Saml2AuthenticationTokenConverter` or `OpenSaml5AuthenticationTokenConverter` to process GET requests, you can call `setShouldConvertGetRequests` to `true.`

0 commit comments

Comments
 (0)