shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Wellmann <hwellmann...@gmail.com>
Subject Re: Eclipse RAP integration
Date Tue, 11 Dec 2012 20:28:31 GMT
Intializing Shiro in an Activator won't have the desired effect.
Activators are run by the OSGi framework startup thread, not by an
HTTP request thread.

I'd recommend using shiro.ini and the usual settings in web.xml
documented for vanilla web applications.

Hope that helps,
Harald

2012/12/11 Jan Stamer <J.Stamer@pe-international.com>:
> 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:l.suhrbier@bgbm.org]
> Gesendet: Dienstag, 11. Dezember 2012 13:13
> An: user@shiro.apache.org
> 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
>
>
>
>

Mime
View raw message