normally it is scanned from the classpath when creating the context from META-INF/openwebbeans/openwebbeans.properties
See https://github.com/apache/openwebbeans/blob/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java#L222 But seems we enforce the security service: https://github.com/apache/openwebbeans/blob/trunk/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/TomcatWebPlugin.java so until you use asynchronism it should work: https://github.com/apache/openwebbeans/blob/trunk/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat7/TomcatSecurityService.java Maybe you can check these few entry points. Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-07-08 14:38 GMT+02:00 [email protected] <[email protected]>: > On 08/07/2016 00:50, Romain Manni-Bucau wrote: > > Bonjour Ludovic, > > you need to > extend org.apache.webbeans.corespi.security.ManagedSecurityService to > implement getCurrentPrincipal() using probably a thread local to get the > request (or gettng it from CDI) to access the servlet principal. > > The configuration of that service is done through openwebbeans.properties. > > Thanks (again) for your kind and quick reply. > > I did not suceed to let openwebbeans.properties scanned when using tomcat > embedded. I use openwebbeans.properties in other projects, but in "regular > tomcat". > > I took another way : I use the servlet module and > > @Inject @DeltaSpike > HttpServletRequest request; > > then request.getUserPrincipal() and zou. > > I would be interested however to find how to get openwebbeans.properties > taken into account by tomcat embedded. :-) > > Thanks again; > > Ludovic > | > | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT. > | >
