Hi Lutz,

we are also using Apache Shiro with OSGi (Eclipse Equinox). What we do is 
register the Shiro filter with the OSGi HttpService.
We use Blueprint and Shiro's Spring add-on to configure Shiro. With that 
setting we are very happy!

I can't tell you how to configure Shiro in OSGi without using Blueprint though.

Bye,
Jan

-----Ursprüngliche Nachricht-----
Von: Lutz Suhrbier [mailto:[email protected]] 
Gesendet: Dienstag, 11. Dezember 2012 13:13
An: [email protected]
Betreff: Eclipse RAP integration

Hello,

I am trying to find the right way to integrate Shiro 1.2.1 within Eclipse RAP.
Actually, I have followed other recommendations to simply initialize Shiro 
within the RAP-OSGi Activator constructor like this.

Factory<SecurityManager> factory = new
IniSecurityManagerFactory("file:path_to_shiro.ini");
SecurityManager securityManager = factory.getInstance(); 
SecurityUtils.setSecurityManager(securityManager);

At first glance, it appears working fine, but when a user pushed the reload 
button in the browser, SecurityUtils.getSubject() appears to always creates a 
new Subject instance and isAuthenticated() returns false.

What I already evaluated, is that the servlet sessionid, which I can get with 
RWT.getRequest().getSession().getId() remains identical, while the
Subject.getSession().getId() has changed. Also, the
SecurityUtils.getSubject() implementation appears to be bound to the current 
thread, so I think if a new request would be processed within another thread by 
the servlet container (Jetty 8, as included in eclipse juno here), it is 
logical that getSubject() can not retrieve the former session info, because 
this is bound to another thread.

Did anybody achieved to get Eclipse RAP and Shiro working properly together ?

And, as I am quite new to all that OSGI and servlet containter stuff, is there 
a way to manage that configuring shiro filters or listeners will work out of 
the box within my Eclipse Juno environment ?

Thanks
Lutz




Reply via email to