Skip to content

Commit 1b4b91a

Browse files
committed
Merge branch '5.8.x' into 6.0.x
2 parents c7a6cef + b969179 commit 1b4b91a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/modules/ROOT/pages/servlet/authentication/persistence.adoc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ The {security-api-url}org/springframework/security/web/context/SecurityContextPe
192192

193193
image::{figures}/securitycontextpersistencefilter.png[]
194194

195-
<1> Before running the rest of the application, `SecurityContextPersistenceFilter` loads the `SecurityContext` from the `SecurityContextRepository` and sets it on the `SecurityContextHolder`.
196-
<2> Next, the application is ran.
197-
<3> Finally, if the `SecurityContext` has changed, we save the `SecurityContext` using the `SecurityContextPersistenceRepository`.
195+
image:{icondir}/number_1.png[] Before running the rest of the application, `SecurityContextPersistenceFilter` loads the `SecurityContext` from the `SecurityContextRepository` and sets it on the `SecurityContextHolder`.
196+
197+
image:{icondir}/number_2.png[] Next, the application is ran.
198+
199+
image:{icondir}/number_3.png[] Finally, if the `SecurityContext` has changed, we save the `SecurityContext` using the `SecurityContextPersistenceRepository`.
198200
This means that when using `SecurityContextPersistenceFilter`, just setting the `SecurityContextHolder` will ensure that the `SecurityContext` is persisted using `SecurityContextRepository`.
199201

200202
In some cases a response is committed and written to the client before the `SecurityContextPersisteneFilter` method completes.
@@ -211,11 +213,12 @@ The {security-api-url}org/springframework/security/web/context/SecurityContextHo
211213

212214
image::{figures}/securitycontextholderfilter.png[]
213215

214-
<1> Before running the rest of the application, `SecurityContextHolderFilter` loads the `SecurityContext` from the `SecurityContextRepository` and sets it on the `SecurityContextHolder`.
215-
<2> Next, the application is ran.
216+
image:{icondir}/number_1.png[] Before running the rest of the application, `SecurityContextHolderFilter` loads the `SecurityContext` from the `SecurityContextRepository` and sets it on the `SecurityContextHolder`.
217+
218+
image:{icondir}/number_2.png[] Next, the application is ran.
216219

217220
Unlike, xref:servlet/authentication/persistence.adoc#securitycontextpersistencefilter[`SecurityContextPersistenceFilter`], `SecurityContextHolderFilter` only loads the `SecurityContext` it does not save the `SecurityContext`.
218221
This means that when using `SecurityContextHolderFilter`, it is required that the `SecurityContext` is explicitly saved.
219222

220223

221-
include::partial$servlet/architecture/security-context-explicit.adoc[]
224+
include::partial$servlet/architecture/security-context-explicit.adoc[]

0 commit comments

Comments
 (0)