Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0, 1.2.1
    • Fix Version/s: None
    • Component/s: Integration: JEE

      Description

      As there is a spring or guice integration, a CDI integration could be welcomed.

      1. SHIRO-337.patch
        22 kB
        Romain Manni-Bucau
      2. SHIRO-337-2.patch
        23 kB
        Romain Manni-Bucau
      3. SHIRO-337-3.patch
        25 kB
        Harald Wellmann

        Issue Links

          Activity

          Hide
          Romain Manni-Bucau added a comment -

          a patch proposal

          Show
          Romain Manni-Bucau added a comment - a patch proposal
          Hide
          Thibault Tigeon added a comment -

          +1

          Show
          Thibault Tigeon added a comment - +1
          Hide
          Romain Manni-Bucau added a comment -

          an update which manage in a better way exception handling

          Show
          Romain Manni-Bucau added a comment - an update which manage in a better way exception handling
          Hide
          Jason Porter added a comment -

          Something that may be interesting for all parties is Shiro integration with DeltaSpike: https://cwiki.apache.org/confluence/display/DeltaSpike/Index Of course basic CDI integration within Shiro would be awesome and probably help in creating a full blown module within DeltaSpike.

          Show
          Jason Porter added a comment - Something that may be interesting for all parties is Shiro integration with DeltaSpike: https://cwiki.apache.org/confluence/display/DeltaSpike/Index Of course basic CDI integration within Shiro would be awesome and probably help in creating a full blown module within DeltaSpike.
          Hide
          Romain Manni-Bucau added a comment -

          deltaspike will be great but doing a single module based on deltaspike means each application using cdi + shiro will need deltaspike which could not be the case (even if in JEE projects it will (almost always) be )

          i think both modules can make sense

          tought?

          Show
          Romain Manni-Bucau added a comment - deltaspike will be great but doing a single module based on deltaspike means each application using cdi + shiro will need deltaspike which could not be the case (even if in JEE projects it will (almost always) be ) i think both modules can make sense tought?
          Hide
          Thibault Tigeon added a comment -

          Would it be possible to have this patch in the next release?

          Show
          Thibault Tigeon added a comment - Would it be possible to have this patch in the next release?
          Hide
          Christian Müller added a comment - - edited

          We have issues running Shiro inside of JBoss 7. Anything we can do to get this (one year old) patch applied? Anybody faced the same issue and found a workaround?

          Our stack trace (using Shiro 1.2.1):

          14:56:08,519 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."xxx-gui.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."xxx-gui.war".WeldService: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class org.apache.shiro.realm.AuthenticatingRealm is not proxyable because the type is final or it contains a final method public final void org.apache.shiro.realm.AuthenticatingRealm.init() - Managed Bean [class net.atos.xa.rm.app.realm.RMRealm] with qualifiers [@Any @Default].
                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)
                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]
                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]
                          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
          
          

          Thanks in advance,
          Christian

          Show
          Christian Müller added a comment - - edited We have issues running Shiro inside of JBoss 7. Anything we can do to get this (one year old) patch applied? Anybody faced the same issue and found a workaround? Our stack trace (using Shiro 1.2.1): 14:56:08,519 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."xxx-gui.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."xxx-gui.war".WeldService: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class org.apache.shiro.realm.AuthenticatingRealm is not proxyable because the type is final or it contains a final method public final void org.apache.shiro.realm.AuthenticatingRealm.init() - Managed Bean [class net.atos.xa.rm.app.realm.RMRealm] with qualifiers [@Any @Default]. at org.jboss.as.weld.services.WeldService.start(WeldService.java:83) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0] at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0] Thanks in advance, Christian
          Hide
          Harald Wellmann added a comment -

          Christian, I don't think this patch is related to your problem. I'm also using Shiro with CDI on JBoss AS 7.1.3 with a custom FooRealm extending AuthorizingRealm, and I don't see this error. I suppose the difference is that my realm is @Dependent (and thus does not require a proxy) whereas yours is @ApplicationScoped.

          Show
          Harald Wellmann added a comment - Christian, I don't think this patch is related to your problem. I'm also using Shiro with CDI on JBoss AS 7.1.3 with a custom FooRealm extending AuthorizingRealm, and I don't see this error. I suppose the difference is that my realm is @Dependent (and thus does not require a proxy) whereas yours is @ApplicationScoped.
          Hide
          Harald Wellmann added a comment -

          Attached is an improved version of the patch which adds an interceptor binding @ShiroSecured, as JBoss/Weld complained about a missing binding. I also added some more unit tests.

          See also https://github.com/hwellmann/shiro.

          Show
          Harald Wellmann added a comment - Attached is an improved version of the patch which adds an interceptor binding @ShiroSecured, as JBoss/Weld complained about a missing binding. I also added some more unit tests. See also https://github.com/hwellmann/shiro .
          Hide
          Christian Müller added a comment -

          Harald, thanks for sharing your solution and the hint. I will have a look tomorrow on your suggestion with my colleague, who is working on it.
          I hope your patch will find a way to the source code repo soon...

          Show
          Christian Müller added a comment - Harald, thanks for sharing your solution and the hint. I will have a look tomorrow on your suggestion with my colleague, who is working on it. I hope your patch will find a way to the source code repo soon...
          Hide
          Thibault Tigeon added a comment -

          Is it possible to have this functionality in the next release?
          It would be nice

          Thibault

          Show
          Thibault Tigeon added a comment - Is it possible to have this functionality in the next release? It would be nice Thibault
          Hide
          Juan Manuel CABRERA added a comment -

          Would be a great helper in our project too !

          Show
          Juan Manuel CABRERA added a comment - Would be a great helper in our project too !
          Hide
          Les Hazlewood added a comment -

          We'll do our best to have this included in 1.3. I'm trying to knock down bugs this week to allow that to be possible.

          Show
          Les Hazlewood added a comment - We'll do our best to have this included in 1.3. I'm trying to knock down bugs this week to allow that to be possible.
          Hide
          Romain Manni-Bucau added a comment -

          any news?

          Show
          Romain Manni-Bucau added a comment - any news?
          Hide
          Jason Wagner added a comment - - edited

          Not having come across this ticket, I started an implementation of a seperate module for CDI support. Link at https://github.com/TensorWrench/shiro-jee. Will check out what features are in the patch and see what makes sense to carry over.

          Show
          Jason Wagner added a comment - - edited Not having come across this ticket, I started an implementation of a seperate module for CDI support. Link at https://github.com/TensorWrench/shiro-jee . Will check out what features are in the patch and see what makes sense to carry over.
          Hide
          Harald Wellmann added a comment -

          This patch and other unreleased community contributions have been released in an independent extension project Pax Shiro.

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

          Sources:
          https://github.com/ops4j/org.ops4j.pax.shiro

          Show
          Harald Wellmann added a comment - This patch and other unreleased community contributions have been released in an independent extension project Pax Shiro. Docs: http://team.ops4j.org/wiki/display/PAXSHIRO/ Sources: https://github.com/ops4j/org.ops4j.pax.shiro
          Hide
          Romain Manni-Bucau added a comment -

          Les Hazlewood what's blocking to get it included? pax config is nice, interceptor is quite common to all versions (reusing existing aop base of shiro) and shiro handlers (session, subject, security manager) too

          Show
          Romain Manni-Bucau added a comment - Les Hazlewood what's blocking to get it included? pax config is nice, interceptor is quite common to all versions (reusing existing aop base of shiro) and shiro handlers (session, subject, security manager) too
          Hide
          Jason Wagner added a comment -

          I would concur. At the very least a prominent link to it in the documentation would be appreciated. It would have prevented me from implementing duplicate capabilities.

          Show
          Jason Wagner added a comment - I would concur. At the very least a prominent link to it in the documentation would be appreciated. It would have prevented me from implementing duplicate capabilities.
          Hide
          Brian Demers added a comment -

          This is one of the highest voted issues, so...
          I took a quick look at this, originally missing the 'ops4j/org.ops4j.pax.shiro' link (I going to poke around in there too)

          One issue is the author tags (ASF recommendation), I cannot strip them without consent from the author Harald Wellmann, confirmation here should be enough.

          Show
          Brian Demers added a comment - This is one of the highest voted issues, so... I took a quick look at this, originally missing the 'ops4j/org.ops4j.pax.shiro' link (I going to poke around in there too) One issue is the author tags (ASF recommendation), I cannot strip them without consent from the author Harald Wellmann , confirmation here should be enough.
          Hide
          Harald Wellmann added a comment -

          Feel free to reuse my code and remove the author tags!

          Show
          Harald Wellmann added a comment - Feel free to reuse my code and remove the author tags!
          Hide
          ASF GitHub Bot added a comment -

          GitHub user bdemers opened a pull request:

          https://github.com/apache/shiro/pull/24

          WIP: CDI feature import SHIRO-337

          I spent about a day looking into this, the original code was pretty good, but I ran into a few issues when adding a sample project

          Added CDI [README.md](support/cdi/README.md)
          Added TODO's:

          • [support/cdi](support/cdi/TODO.md)
          • [samples](samples/cdi/TODO.md)

          Comments above are just initial thoughts and are here to start discussion.

          @hwellmann, I know it has been a while since you looked into this, but your thoughts would be appreciated

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/bdemers/shiro cdi-import

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/shiro/pull/24.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #24


          commit daff202fe1a46141badcf73309d3237dcf4f8ef0
          Author: Brian Demers <bdemers@apache.org>
          Date: 2016-07-05T19:35:35Z

          Initial CDI import

          commit 8e40907d67e38b961ddffba7a2411bc8745f8139
          Author: Brian Demers <bdemers@apache.org>
          Date: 2016-07-05T19:38:53Z

          renamed cdi packages after import

          commit b806d61d40aad94db5e9f76b10e57d54cab8ba52
          Author: Brian Demers <bdemers@apache.org>
          Date: 2016-07-05T20:14:46Z

          Replaced geronimo spec dependencies with javax equivalents

          commit 4dfcbd0b770b2d45e8daf52f6ad80a26c9abb16b
          Author: Brian Demers <bdemers@apache.org>
          Date: 2016-07-05T20:33:06Z

          Removed @author javadoc tags

          commit 0200e716f2df8ad552bc852b356485696fae07a6
          Author: Brian Demers <bdemers@apache.org>
          Date: 2016-07-05T21:00:42Z

          Updated license headers to match project

          commit 8c380223fd8acc02f6d809a426e31079cd11c9c0
          Author: Brian Demers <bdemers@apache.org>
          Date: 2016-07-06T16:34:32Z

          Attempting to add a CDI example from ops4j/org.ops4j.pax.shiro

          original sample: https://github.com/ops4j/org.ops4j.pax.shiro/blob/master/samples/sample-cdi-web
          Added README.md from: https://ops4j1.jira.com/wiki/display/PAXSHIRO/CDI+Support
          Added TODO.md in support/cdi and samples/cdi with thoughts on the project


          Show
          ASF GitHub Bot added a comment - GitHub user bdemers opened a pull request: https://github.com/apache/shiro/pull/24 WIP: CDI feature import SHIRO-337 I spent about a day looking into this, the original code was pretty good, but I ran into a few issues when adding a sample project Added CDI [README.md] (support/cdi/README.md) Added TODO's: [support/cdi] (support/cdi/TODO.md) [samples] (samples/cdi/TODO.md) Comments above are just initial thoughts and are here to start discussion. @hwellmann, I know it has been a while since you looked into this, but your thoughts would be appreciated You can merge this pull request into a Git repository by running: $ git pull https://github.com/bdemers/shiro cdi-import Alternatively you can review and apply these changes as the patch at: https://github.com/apache/shiro/pull/24.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #24 commit daff202fe1a46141badcf73309d3237dcf4f8ef0 Author: Brian Demers <bdemers@apache.org> Date: 2016-07-05T19:35:35Z Initial CDI import commit 8e40907d67e38b961ddffba7a2411bc8745f8139 Author: Brian Demers <bdemers@apache.org> Date: 2016-07-05T19:38:53Z renamed cdi packages after import commit b806d61d40aad94db5e9f76b10e57d54cab8ba52 Author: Brian Demers <bdemers@apache.org> Date: 2016-07-05T20:14:46Z Replaced geronimo spec dependencies with javax equivalents commit 4dfcbd0b770b2d45e8daf52f6ad80a26c9abb16b Author: Brian Demers <bdemers@apache.org> Date: 2016-07-05T20:33:06Z Removed @author javadoc tags commit 0200e716f2df8ad552bc852b356485696fae07a6 Author: Brian Demers <bdemers@apache.org> Date: 2016-07-05T21:00:42Z Updated license headers to match project commit 8c380223fd8acc02f6d809a426e31079cd11c9c0 Author: Brian Demers <bdemers@apache.org> Date: 2016-07-06T16:34:32Z Attempting to add a CDI example from ops4j/org.ops4j.pax.shiro original sample: https://github.com/ops4j/org.ops4j.pax.shiro/blob/master/samples/sample-cdi-web Added README.md from: https://ops4j1.jira.com/wiki/display/PAXSHIRO/CDI+Support Added TODO.md in support/cdi and samples/cdi with thoughts on the project
          Hide
          Brian Demers added a comment -

          Moving out of 1.3 release.

          The pull request in this issue needs a little more discussion.
          (please chime in if interested)

          Show
          Brian Demers added a comment - Moving out of 1.3 release. The pull request in this issue needs a little more discussion. (please chime in if interested)

            People

            • Assignee:
              Unassigned
              Reporter:
              Romain Manni-Bucau
            • Votes:
              17 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

              • Created:
                Updated:

                Development