Skip to content

Commit 5760b6d

Browse files
committed
Add AuthenticationServiceException Reactive Migration Steps
Issue gh-9429 Issue gh-12132
1 parent f9a2d22 commit 5760b6d

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

docs/modules/ROOT/pages/migration.adoc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,56 @@ changes to:
345345

346346
'''
347347

348+
=== Propagate ``AuthenticationServiceException``s
349+
350+
{security-api-url}org/springframework/security/web/server/authentication/AuthenticationWebFilter.html[`AuthenticationWebFilter`] propagates {security-api-url}org/springframework/security/authentication/AuthenticationServiceException.html[``AuthenticationServiceException``]s to the {security-api-url}org/springframework/security/web/server/ServerAuthenticationEntryPoint.html[`ServerAuthenticationEntryPoint`].
351+
Because ``AuthenticationServiceException``s represent a server-side error instead of a client-side error, in 6.0, this changes to propagate them to the container.
352+
353+
So, if you opted into this behavior by setting `rethrowAuthenticationServiceException` too `true`, you can now remove it like so:
354+
355+
====
356+
.Java
357+
[source,java,role="primary"]
358+
----
359+
AuthenticationFailureHandler bearerFailureHandler = new ServerAuthenticationEntryPointFailureHandler(bearerEntryPoint);
360+
bearerFailureHandler.setRethrowAuthenticationServiceException(true);
361+
AuthenticationFailureHandler basicFailureHandler = new ServerAuthenticationEntryPointFailureHandler(basicEntryPoint);
362+
basicFailureHandler.setRethrowAuthenticationServiceException(true);
363+
----
364+
365+
.Kotlin
366+
[source,kotlin,role="secondary"]
367+
----
368+
val bearerFailureHandler: AuthenticationFailureHandler = ServerAuthenticationEntryPointFailureHandler(bearerEntryPoint)
369+
bearerFailureHandler.setRethrowAuthenticationServiceException(true)
370+
val basicFailureHandler: AuthenticationFailureHandler = ServerAuthenticationEntryPointFailureHandler(basicEntryPoint)
371+
basicFailureHandler.setRethrowAuthenticationServiceException(true)
372+
----
373+
====
374+
375+
changes to:
376+
377+
====
378+
.Java
379+
[source,java,role="primary"]
380+
----
381+
AuthenticationFailureHandler bearerFailureHandler = new ServerAuthenticationEntryPointFailureHandler(bearerEntryPoint);
382+
AuthenticationFailureHandler basicFailureHandler = new ServerAuthenticationEntryPointFailureHandler(basicEntryPoint);
383+
----
384+
385+
.Kotlin
386+
[source,kotlin,role="secondary"]
387+
----
388+
val bearerFailureHandler: AuthenticationFailureHandler = ServerAuthenticationEntryPointFailureHandler(bearerEntryPoint)
389+
val basicFailureHandler: AuthenticationFailureHandler = ServerAuthenticationEntryPointFailureHandler(basicEntryPoint)
390+
----
391+
====
392+
393+
[NOTE]
394+
====
395+
If you configured the `ServerAuthenticationFailureHandler` only for the purpose of updating to 6.0, you can remove it completely.
396+
====
397+
348398
[[revert]]
349399
If you are running into trouble with any of the 6.0 changes, please first try to apply the following changes to get you up and running.
350400
It's more important to stay on 6.0 and get the security improvements.

0 commit comments

Comments
 (0)