How can I use a scheduled task with a client that provides also web-page using keycloak?

后端 未结 3 1780
逝去的感伤
逝去的感伤 2021-01-21 07:03

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

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-21 07:42

    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.

提交回复
热议问题