Skip to content

Commit 4ed131f

Browse files
committed
Add shouldConvertGetRequests Migration Steps
Issue gh-17099
1 parent 8953f46 commit 4ed131f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,42 @@ fun jwtDecoder(): JwtDecoder {
7878
======
7979
<1> - `validateTypes` now defaults to `false`
8080
<2> - `JwtTypeValidator#jwt` is added by all `createDefaultXXX` methods
81+
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` 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 `Saml2AuthenticationTokenConverter` like so:
89+
90+
[tabs]
91+
======
92+
Java::
93+
+
94+
[source,java,role="primary"]
95+
----
96+
@Bean
97+
Saml2AuthenticationTokenConverter authenticationConverter(RelyingPartyRegistrationRepository registrations) {
98+
Saml2AuhenticationTokenConverter authenticationConverter = new Saml2AuthenticationTokenConverter(
99+
new DefaultRelyingPartyRegistrationResolver(registrations));
100+
authenticationConverter.setShouldConvertGetRequests(false);
101+
return authenticationConverter;
102+
}
103+
----
104+
105+
Kotlin::
106+
+
107+
[source,kotlin,role="secondary"]
108+
----
109+
@Bean
110+
fun authenticationConverter(val registrations: RelyingPartyRegistrationRepository): Saml2AuthenticationTokenConverter {
111+
val authenticationConverter = new Saml2AuthenticationTokenConverter(
112+
DefaultRelyingPartyRegistrationResolver(registrations))
113+
authenticationConverter.setShouldConvertGetRequests(false)
114+
return authenticationConverter
115+
}
116+
----
117+
======
118+
119+
If you must continue using `Saml2AuthenticationTokenConverter` to process GET requests, you can call `setShouldConvertGetRequests` to `true.`

0 commit comments

Comments
 (0)