2 Replies Latest reply on Mar 1, 2018 11:49 AM by Philipp Nanz

    Elytron and AuthenticationContext propagation from one thread to another

    Philipp Nanz Newbie

      Hi folks,


      I'm currently in the process of migrating a legacy web application from JBoss 7 to WildFly 11 and there is one thing that is causing me headache: The application is spawning new threads inside a web request (Don't ask! :-) ), and in the good old JBoss 7 days it propagated the current authentication context to the new thread thanks to the usage of a InheritableThreadLocal (see [AS7-4687] Review the use of InheritableThreadLocal in SecurityContextAssociation - JBoss Issue Tracker ).


      I understand that Elytron is no longer using this InheritableThreadLocal approach and that is perfectly fine for me. Looking at the API of Elytron I hoped that AuthenticationContext.captureCurrent() or something like that might come to the rescue, but playing around with it I wasn't able to get it work.


      So my question is: Is this what I would like to do (propagate auth context from one thread to another) possible at all using Elytron API? If so, could you give me any hints where to start looking?


      Thanks in advance and kind regards,