Three verified programs (JDK 25, Spring Security 7.1.1, Spring Boot 4.1.1 dependency versions) backing the ankurm.com post: InheritableThreadLocal across thread models, @Async on a virtual-thread SimpleAsyncTaskExecutor (DelegatingSecurityContextExecutor vs ContextPropagatingTaskDecorator), and StructuredTaskScope.fork() propagation. Captured console output and docs chapters included.
6 lines
284 B
Plaintext
6 lines
284 B
Plaintext
=== Demo 3: StructuredTaskScope.fork() + SecurityContext ===
|
|
A) plain fork, MODE_THREADLOCAL: NO AUTHENTICATION (lost)
|
|
B) plain fork, MODE_INHERITABLETHREADLOCAL: authenticated as frank
|
|
C) manual capture/restore: authenticated as grace
|
|
D) ContextSnapshot.wrap: authenticated as heidi
|