You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Harald Wellmann <hw...@gmail.com> on 2013/08/30 18:47:46 UTC

OPS4J Pax Shiro extends Apache Shiro for Java EE 6+

This is to announce the release of OPS4J Pax Shiro 0.1.0, extending 
Apache Shiro for Java EE 6/7 and OSGi.

The initial components are integrations with CDI and JSF, derived from 
contributions by various Apache Shiro users that have not been picked up 
or released by the Apache Shiro team.

In addition, Pax Shiro contains samples and integration tests, 
demonstrating the usage of these components both in Java EE and in OSGi 
environments.

Pax Shiro 0.1.0 artifacts are available from Maven Central.

They depend on Apache Shiro 1.2.2.

Documentation:
http://team.ops4j.org/wiki/display/PAXSHIRO/

Source repository:
https://github.com/ops4j/org.ops4j.pax.shiro

Issues:
http://team.ops4j.org/browse/PAXSHIRO

Continuous Integration:
http://ci.ops4j.org/jenkins/job/org.ops4j.pax.shiro/

Maven Snapshots:
https://oss.sonatype.org/content/repositories/ops4j-snapshots/org/ops4j/pax/shiro

Best regards,
Harald

Re: OPS4J Pax Shiro extends Apache Shiro for Java EE 6+

Posted by Harald Wellmann <hw...@gmail.com>.
Shiro itself works fine with OSGi, I didn't mean to imply anything else.

I'm not sure whether or not Apache Shiro includes any OSGi regression 
tests, but the aim of Pax Shiro is to test all of its own extensions 
both on Java EE and on OSGi, and of course these regression tests will 
implicitly also test the underlying Apache Shiro core bundles.

One of the problems I ran into when testing pax-shiro-faces on Equinox 
is that JSF taglibs do not seem to work well in OSGi in general.

But this is not related to Shiro, you'll see the same kind of issue when 
trying to use PrimeFaces or any other JSF library which is not embedded 
in your WAB but provisioned as a separate bundle.

The problem is that META-INF/* config resources from other bundles are 
not accessible via the WAB bundle classloader by default.

This is addressed by a fragment customizing the Jetty boot bundle.

Hope that makes things clearer.

Best regards,
Harald

Am 30.08.2013 19:08, schrieb Chris Geer:
> Harald,
>
> I was just looking through the site and had a question for you. When you
> say you extended Shiro to support OSGI, what exactly do you mean? Do you
> mean you've enabled JSF support for Shiro in OSGI? Or did you do
> additional work to support Shiro in OSGI generically?
>
> We currently use Shiro in our OSGI container today (Apache CXF
> endpoints) but I'm always looking for better approaches. Would your
> project be applicable, or is it only really applicable to JSF projects?
>
> Thanks,
> Chris


Re: OPS4J Pax Shiro extends Apache Shiro for Java EE 6+

Posted by Chris Geer <ch...@cxtsoftware.com>.
Harald,

I was just looking through the site and had a question for you. When you
say you extended Shiro to support OSGI, what exactly do you mean? Do you
mean you've enabled JSF support for Shiro in OSGI? Or did you do additional
work to support Shiro in OSGI generically?

We currently use Shiro in our OSGI container today (Apache CXF endpoints)
but I'm always looking for better approaches. Would your project be
applicable, or is it only really applicable to JSF projects?

Thanks,
Chris


On Fri, Aug 30, 2013 at 9:47 AM, Harald Wellmann <hw...@gmail.com>wrote:

> This is to announce the release of OPS4J Pax Shiro 0.1.0, extending Apache
> Shiro for Java EE 6/7 and OSGi.
>
> The initial components are integrations with CDI and JSF, derived from
> contributions by various Apache Shiro users that have not been picked up or
> released by the Apache Shiro team.
>
> In addition, Pax Shiro contains samples and integration tests,
> demonstrating the usage of these components both in Java EE and in OSGi
> environments.
>
> Pax Shiro 0.1.0 artifacts are available from Maven Central.
>
> They depend on Apache Shiro 1.2.2.
>
> Documentation:
> http://team.ops4j.org/wiki/**display/PAXSHIRO/<http://team.ops4j.org/wiki/display/PAXSHIRO/>
>
> Source repository:
> https://github.com/ops4j/org.**ops4j.pax.shiro<https://github.com/ops4j/org.ops4j.pax.shiro>
>
> Issues:
> http://team.ops4j.org/browse/**PAXSHIRO<http://team.ops4j.org/browse/PAXSHIRO>
>
> Continuous Integration:
> http://ci.ops4j.org/jenkins/**job/org.ops4j.pax.shiro/<http://ci.ops4j.org/jenkins/job/org.ops4j.pax.shiro/>
>
> Maven Snapshots:
> https://oss.sonatype.org/**content/repositories/ops4j-**
> snapshots/org/ops4j/pax/shiro<https://oss.sonatype.org/content/repositories/ops4j-snapshots/org/ops4j/pax/shiro>
>
> Best regards,
> Harald
>

Re: OPS4J Pax Shiro extends Apache Shiro for Java EE 6+

Posted by versatec <ro...@versatec.de>.
I suggest you add a hint to the pax shiro documentation that CDI beans have
to be referenced by name in order for them to be instantiated through CDI -
'@ShiroIni' implies '@Named'. If one does the following 'mongoRealm' and
'rolePermissionResolver' are instantiated through regular shiro without CDI
integration, so anything annotated '@Inject' will *not *be injected:
[main]
mongoRealm = de.versatec.mongo.shiro.MongoRealm
...
rolePermissionResolver =
de.versatec.mongo.shiro.ActiveDirectoryRolePermissionResolver
rolePermissionResolver.tenantId = versatec.invalid
activeDirectoryRealm.rolePermissionResolver = $rolePermissionResolver
securityManager.realms = $mongoRealm, $activeDirectoryRealm
-------------
Instead one has to do this when using pax shiro for CDI integration
($mongoRealm and $activeDirectoryRolePermissionResolver are now instantiated
through CDI):
[main]
activeDirectoryRealm.rolePermissionResolver =
$activeDirectoryRolePermissionResolver
activeDirectoryRealm.rolePermissionResolver.tenantId = versatec.invalid
securityManager.realms = $mongoRealm, $activeDirectoryRealm
#Mark how we use references to the two classes without explicitly defining
them in shiro.ini
-----------
MongoRealm.java:
...
@ShiroIni
public class MongoRealm extends AuthorizingRealm {

    @Inject
    private MongoProvider mongoProvider;
...
}





--
View this message in context: http://shiro-user.582556.n2.nabble.com/OPS4J-Pax-Shiro-extends-Apache-Shiro-for-Java-EE-6-tp7579096p7579154.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: OPS4J Pax Shiro extends Apache Shiro for Java EE 6+

Posted by versatec <ro...@versatec.de>.
Thanks to you I may finally use @Inject in my custom realms instead of having
to JNDI them.




--
View this message in context: http://shiro-user.582556.n2.nabble.com/OPS4J-Pax-Shiro-extends-Apache-Shiro-for-Java-EE-6-tp7579096p7579124.html
Sent from the Shiro User mailing list archive at Nabble.com.