ParameterResolver for spring's Principal

Hello,
is it somehow possible to resolve spring’s Principal as method argument?
I’ve tried to add SpringBeanParameterResolverFactory to my configuration, but that didn’t helped me.
Thanks

@Bean
AnnotationCommandHandlerBeanPostProcessor annotationCommandHandlerBeanPostProcessor() {
   AnnotationCommandHandlerBeanPostProcessor processor = new AnnotationCommandHandlerBeanPostProcessor();
   processor.setParameterResolverFactory(new SpringBeanParameterResolverFactory());
   processor.setCommandBus(commandBus());
   return processor;
}

Hi,

The SpringBeanParameterResolver only resolves parameters that are Spring beans. Axon Framework does not provide a resolver for parameters of type Principal. However, you can easily write a parameter resolver yourself that retrieves the current principal from the SecurityContext and subsequently returns it, so it can be passed to the message handler.

Regards,

Joris