I\'m using Spring Boot and Keycloak to develop a web-app. Then I wrote a scheduled task where I\'m using the KeycloakRestTemplate to ask s
Spring Boot
Keycloak
KeycloakRestTemplate
By default SecurityContextHolder use a THREAD_LOCAL strategy, and thus other threads don't inherit the context from their parent. Look at the Javadoc for MODE_INHERITABLETHREADLOCAL to see if it corresponds to your needs.