You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by Mihir Chhaya <mi...@gmail.com> on 2025/04/07 21:49:48 UTC
PAX - SHIRO
Hello,
We are currently using Apache Shiro 1.13.0 and planning to upgrade to 2.x.
Following is our module.xml file (JBOSS module structure for jar reference
on classpath).
As you can see, we have pax-shiro cdi and cdi-web used in our JSF based
applications.
As I don't see pax.shiro being upgraded after 2013, can you suggest any
alternative option, or if we can remove pax shiro altogether?
*JBOSS/customlib/shiro/module.xml*
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="app.apache.shiro" >
<resources>
<resource-root path="shiro-core-1.13.0.jar" />
<resource-root path="shiro-web-1.13.0.jar" />
<resource-root path="pax-shiro-cdi-0.1.0.jar" />
<resource-root path="pax-shiro-cdi-web-0.1.0.jar" />
<resource-root path="pax-shiro-faces-0.1.0.jar" />
<resource-root path="encoder-1.2.3.jar"/>
</resources>
<dependencies>
<module name="org.apache.commons.beanutils"/>
<module name="org.apache.commons.collections"/>
<module name="org.slf4j"/>
<module name="javax.api" export="true"/>
<module name="javax.faces.api" export="true" />
<module name="javax.enterprise.api" export="true" />
</dependencies>
</module>
*pax.shiro used in web.xml file*
<context-param>
<param-name>shiroEnvironmentClass</param-name>
<param-value>org.ops4j.pax.shiro.cdi.web.CdiIniWebEnvironment</param-value>
</context-param>
*beans.xml*
<interceptors>
<class>org.ops4j.pax.shiro.cdi.interceptor.ShiroInterceptor</class>
</interceptors>
Thank you,
-Mihir.
Re: PAX - SHIRO
Posted by Steinar Bang <sb...@dod.no>.
>>>>> lenny-5o6P1Tln9C5DPfheJLI6IQ@public.gmane.org:
> Hi Mihir,
> You are correct, Pax-Shiro is no longer maintained.
> Shiro 2.0 has all the features that used to be in Pax-Shiro (and many, many more)
> Please see https://shiro.apache.org/jakarta-ee.html
> You can probably remove most if not all related configuration because it’s no longer necessary in Shiro 2.0
FWIW I am a user of shiro in OSGi (in apache karaf) and plain shiro
2.0.2 works fine in OSGi.
Use OSGi Service Component Runtime (SCR)/Declarative Services (DS) as
the OSGi, and create SCR/DS components that expose Realm and SessionDAO as
OSGi services
https://github.com/steinarb/authservice/blob/master/authservice/authservice.web.security.dbrealm/src/main/java/no/priv/bang/authservice/web/security/dbrealm/AuthserviceDbRealm.java#L23
https://github.com/steinarb/authservice/blob/master/authservice/authservice.web.security.memorysession/src/main/java/no/priv/bang/authservice/web/security/memorysession/MemorySession.java#L23
And then I start a component that create a ServiceContextHelper
that connects to the OSGi web whiteboard, to get a web context to
connect servlets and filters to
https://github.com/steinarb/authservice/blob/master/authservice/authservice.web.security/src/main/java/no/priv/bang/authservice/web/security/AuthserviceServletContextHelper.java#L22
And create a ShiroFilter that creates a avax.servlet.Filter OSGi service
that connects to the web context from the previous URL in the OSGi web
whiteboard and reads the apps shiro.ini and do the rest of config with
code:
https://github.com/steinarb/authservice/blob/master/authservice/authservice.web.security/src/main/java/no/priv/bang/authservice/web/security/AuthserviceShiroFilter.java#L41
Re: PAX - SHIRO
Posted by le...@flowlogix.com.
Hi Mihir,
You are correct, Pax-Shiro is no longer maintained.
Shiro 2.0 has all the features that used to be in Pax-Shiro (and many, many more)
Please see https://shiro.apache.org/jakarta-ee.html
You can probably remove most if not all related configuration because it’s no longer necessary in Shiro 2.0
> On Apr 7, 2025, at 4:49 PM, Mihir Chhaya <mi...@gmail.com> wrote:
>
> Hello,
>
> We are currently using Apache Shiro 1.13.0 and planning to upgrade to 2.x.
> Following is our module.xml file (JBOSS module structure for jar reference
> on classpath).
>
> As you can see, we have pax-shiro cdi and cdi-web used in our JSF based
> applications.
>
> As I don't see pax.shiro being upgraded after 2013, can you suggest any
> alternative option, or if we can remove pax shiro altogether?
>
> *JBOSS/customlib/shiro/module.xml*
> <?xml version="1.0" encoding="UTF-8"?>
> <module xmlns="urn:jboss:module:1.1" name="app.apache.shiro" >
> <resources>
> <resource-root path="shiro-core-1.13.0.jar" />
> <resource-root path="shiro-web-1.13.0.jar" />
> <resource-root path="pax-shiro-cdi-0.1.0.jar" />
> <resource-root path="pax-shiro-cdi-web-0.1.0.jar" />
> <resource-root path="pax-shiro-faces-0.1.0.jar" />
> <resource-root path="encoder-1.2.3.jar"/>
> </resources>
> <dependencies>
> <module name="org.apache.commons.beanutils"/>
> <module name="org.apache.commons.collections"/>
> <module name="org.slf4j"/>
> <module name="javax.api" export="true"/>
> <module name="javax.faces.api" export="true" />
> <module name="javax.enterprise.api" export="true" />
> </dependencies>
> </module>
>
> *pax.shiro used in web.xml file*
> <context-param>
> <param-name>shiroEnvironmentClass</param-name>
> <param-value>org.ops4j.pax.shiro.cdi.web.CdiIniWebEnvironment</param-value>
> </context-param>
>
> *beans.xml*
> <interceptors>
> <class>org.ops4j.pax.shiro.cdi.interceptor.ShiroInterceptor</class>
> </interceptors>
>
>
> Thank you,
> -Mihir.