You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Federico Mariani (Jira)" <ji...@apache.org> on 2025/03/31 08:00:05 UTC
[jira] [Assigned] (CAMEL-21887) camel-platform-http-starter - Add support for Spring security context injection
[ https://issues.apache.org/jira/browse/CAMEL-21887?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Federico Mariani reassigned CAMEL-21887:
----------------------------------------
Assignee: Federico Mariani
> 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
> Assignee: Federico Mariani
> Priority: Major
> Fix For: 4.11.0, 4.10.4
>
>
> 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)