[
https://issues.apache.org/jira/browse/CAMEL-21887?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Federico Mariani updated CAMEL-21887:
-------------------------------------
Component/s: camel-platform-http
camel-spring-boot
> camel-platform-http-starter - Add support for Spring security context
> injection
> -------------------------------------------------------------------------------
>
> Key: CAMEL-21887
> URL: https://issues.apache.org/jira/browse/CAMEL-21887
> Project: Camel
> Issue Type: Improvement
> Components: camel-platform-http, camel-spring-boot
> Reporter: Federico Mariani
> Priority: Major
> Fix For: 4.11.0
>
>
> Spring Boot does not support Principal/ContextSecurity Injection in Async
> method.
> Though it is possible by configuring a
> _DelegatingSecurityContextAsyncTaskExecutor_ that is a wrapper around a
> _ThreadPoolTaskExecutor_.
> Camel platform http starter at the moment only supports
> _ThreadPoolTaskExecutor_ and _SimpleAsyncTaskExecutor_. Support for
> _DelegatingSecurityContextAsyncTaskExecutor_ has to be added and this
> implementation should be prioritized.
> Once done, it will be possible to do the following:
> * Configure spring security following standards
> * configure the wrapper as:
> {code:java}
> @Bean
> public DelegatingSecurityContextAsyncTaskExecutor
> springSecurityTaskExecutorIntegration(ThreadPoolTaskExecutor taskExecutor) {
> return new DelegatingSecurityContextAsyncTaskExecutor(taskExecutor);
> }
> {code}
> * Finally _SecurityContextHolder.getContext().getAuthentication().getName()_
> (in a bean or a processor) will contain the authenticated user name.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)