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
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration.adoc
+7-18
Original file line number
Diff line number
Diff line change
@@ -373,32 +373,25 @@ With the addition of xref:servlet/authentication/persistence.adoc#delegatingsecu
373
373
In Spring Security 6, the deprecated method was removed.
374
374
If you have implemented `SecurityContextRepository` yourself and added an implementation of the `loadContext(request)` method, you can prepare for Spring Security 6 by removing the implementation of that method and implementing the new method instead.
375
375
376
-
To get started implementing the new method, use the following example that adapts a `Supplier<SecurityContext>` to provide a `DeferredSecurityContext`:
376
+
To get started implementing the new method, use the following example to provide a `DeferredSecurityContext`:
377
377
378
-
[NOTE]
379
-
====
380
-
The adapted `Supplier` should return `null` when no `SecurityContext` is available, which was not the case with the `Supplier` returned from `loadContext(request)`.
381
-
====
382
-
383
-
.Adapt `Supplier<SecurityContext>` to `DeferredSecurityContext`
378
+
.Provide `DeferredSecurityContext`
384
379
====
385
380
.Java
386
381
[source,java,role="primary"]
387
382
----
388
383
@Override
389
384
public DeferredSecurityContext loadDeferredContext(HttpServletRequest request) {
390
-
// Adapt a supplier that returns null when the context is not available
0 commit comments