You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2017/07/05 11:21:34 UTC

Re: Integrate Apache Shiro with Struts2

Could you open a PR against https://github.com/apache/struts-examples
and contribute your example there?

2017-06-30 20:54 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> Thank you, look forward to it, I'm working on the same thing!
> I'm using this SO Q&A as my starting point and the accepted answers link
> the an similar example using StromPath:
> https://stackoverflow.com/questions/27063599/writing-custom-shiro-realm
>
> After that is don't I'll be looking to integrate AspectJ and I've
> experimented with Dagger2 so those would be the last pieces before I can do
> the "real work".
>
> On Fri, Jun 30, 2017 at 5:46 AM, Kofford, C. Todd <tk...@ku.edu> wrote:
>
>> Ken, I'm glad to help!
>>
>> I tried to use the latest version of shiro (1.4.0) too, but ran into a
>> some issues. I've posted a message to the shiro user group, and those guys
>> are really good about getting back and resolving issues, so I think it's
>> only a matter of time before that gets resolved.
>>
>> I've started another small project, still on shiro 1.3.2, that
>> demonstrates how to define a custom shiro "realm", where you can do
>> authentication and authorization. It's really pretty easy to implement, so
>> it shouldn't take too long to crank out and post up to GitHub.
>>
>> Todd Kofford
>> tkofford@ku.edu
>>
>> -----Original Message-----
>> From: Ken McWilliams [mailto:ken.mcwilliams@gmail.com]
>> Sent: Thursday, June 29, 2017 1:25 PM
>> To: Struts Users Mailing List <us...@struts.apache.org>
>> Subject: Re: Integrate Apache Shiro with Struts2
>>
>> Todd, thank you this was a huge help!
>>
>> I've followed what you did and added it into a demo project that isn't
>> much more complicated than what you provided, just so I know how it all
>> works.
>>
>> One of the things I found the hard way is if you move to Shiro 1.4 (the
>> latest) it won't start...
>>
>> I would like to turn your project into an struts2/shiro integration guide
>> (although the provided project is quite straight forward). I'm using JPA
>> services to get my user credentials so a bit of a guide there wouldn't
>> hurt, so next step is to figure out how to make that work with shiro.
>>
>> Regards,
>> Ken
>>
>> On Mon, Jun 26, 2017 at 9:40 AM, Kofford, C. Todd <tk...@ku.edu> wrote:
>>
>> > OK, I've just uploaded a very simple struts2 - shiro example to github:
>> > https://github.com/tkofford/struts2shiro. NOTE - this is a very simple
>> > example that uses a default shiro.ini file for
>> > authentication/authorization and struts interceptor for "injecting" the
>> shiro subject into the stack.
>> >
>> > I'll start building a more complicated example that uses spring to
>> > inject the shiro parts, and reply back when that's done.
>> >
>> > Todd Kofford
>> > University of Kansas
>> > tkofford@ku.edu
>> >
>> > -----Original Message-----
>> > From: Ken McWilliams [mailto:ken.mcwilliams@gmail.com]
>> > Sent: Thursday, June 22, 2017 11:10 AM
>> > To: Struts Users Mailing List <us...@struts.apache.org>
>> > Subject: Re: Integrate Apache Shiro with Struts2
>> >
>> > That would be awesome. From having looked around on the web there is
>> > very little Struts2/Shiro content. Some examples would be a great help.
>> >
>> > On Thu, Jun 22, 2017 at 9:51 AM, Kofford, C. Todd <tk...@ku.edu>
>> wrote:
>> >
>> > > We've been using strut2 and shiro for a long time (actually since
>> > > the old jsecurity days). I'd be happy to contribute some trivial and
>> > > more complex examples if needed.
>> > >
>> > > Todd Kofford
>> > > University of Kansas
>> > > tkofford@ku.edu
>> > >
>> > >
>> > > -----Original Message-----
>> > > From: Lukasz Lenart [mailto:lukaszlenart@apache.org]
>> > > Sent: Sunday, June 18, 2017 3:23 AM
>> > > To: Struts Users Mailing List <us...@struts.apache.org>
>> > > Subject: Re: Integrate Apache Shiro with Struts2
>> > >
>> > > 2017-06-17 19:08 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
>> > > > If not I hope to follow up with a solution.
>> > >
>> > > +1 and we can add it to our docs :)
>> > >
>> > >
>> > > Regards
>> > > --
>> > > Łukasz
>> > > + 48 606 323 122 http://www.lenart.org.pl/
>> > >
>> > > --------------------------------------------------------------------
>> > > - To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > > For additional commands, e-mail: user-help@struts.apache.org
>> > >
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>>
>>
>> --
>> Sent from my C64 using a 300 baud modem
>>
>
>
>
> --
> Sent from my C64 using a 300 baud modem

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Integrate Apache Shiro with Struts2

Posted by tkofford <tk...@ku.edu>.
I've just uploaded a more advanced example of a struts - shiro application. 

https://github.com/tkofford/shiro-realm
<https://github.com/tkofford/shiro-realm>  

This one is essentially the same as the simple one I created earlier, except
I am using a custom shiro realm and doing authentication & authorization in
the realm instead of relying on the shiro.ini file and the default shiro
behavior. This application can easily be altered to using a database or some
other data store, and is basically how we implement shiro in all our
applications that use shiro.

Please let me know if you have any problems or any questions using the
project.

Todd Kofford
tkofford@ku.edu



--
View this message in context: http://struts.1045723.n5.nabble.com/Integrate-Apache-Shiro-with-Struts2-tp5721355p5721691.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Integrate Apache Shiro with Struts2

Posted by Lukasz Lenart <lu...@apache.org>.
Thanks, merged!

2017-07-06 17:39 GMT+02:00 Kofford, C. Todd <tk...@ku.edu>:
> PR created.
>
> TK
> tkofford@ku.edu
>
> -----Original Message-----
> From: Lukasz Lenart [mailto:lukaszlenart@apache.org]
> Sent: Thursday, July 6, 2017 7:38 AM
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Integrate Apache Shiro with Struts2
>
> 2017-07-06 14:33 GMT+02:00 Kofford, C. Todd <tk...@ku.edu>:
>> Sure, is there any preference on the name of the new project under "struts-examples", ... "struts-shiro-basic"?
>
> shiro-basic will be enough, thank you :)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Integrate Apache Shiro with Struts2

Posted by "Kofford, C. Todd" <tk...@ku.edu>.
PR created.

TK
tkofford@ku.edu

-----Original Message-----
From: Lukasz Lenart [mailto:lukaszlenart@apache.org] 
Sent: Thursday, July 6, 2017 7:38 AM
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: Re: Integrate Apache Shiro with Struts2

2017-07-06 14:33 GMT+02:00 Kofford, C. Todd <tk...@ku.edu>:
> Sure, is there any preference on the name of the new project under "struts-examples", ... "struts-shiro-basic"?

shiro-basic will be enough, thank you :)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Integrate Apache Shiro with Struts2

Posted by Lukasz Lenart <lu...@apache.org>.
2017-07-06 14:33 GMT+02:00 Kofford, C. Todd <tk...@ku.edu>:
> Sure, is there any preference on the name of the new project under "struts-examples", ... "struts-shiro-basic"?

shiro-basic will be enough, thank you :)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Integrate Apache Shiro with Struts2

Posted by "Kofford, C. Todd" <tk...@ku.edu>.
Sure, is there any preference on the name of the new project under "struts-examples", ... "struts-shiro-basic"?

TK
tkofford@ku.edu

-----Original Message-----
From: Lukasz Lenart [mailto:lukaszlenart@apache.org] 
Sent: Wednesday, July 5, 2017 6:22 AM
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: Re: Integrate Apache Shiro with Struts2

Could you open a PR against https://github.com/apache/struts-examples
and contribute your example there?

2017-06-30 20:54 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
> Thank you, look forward to it, I'm working on the same thing!
> I'm using this SO Q&A as my starting point and the accepted answers 
> link the an similar example using StromPath:
> https://stackoverflow.com/questions/27063599/writing-custom-shiro-real
> m
>
> After that is don't I'll be looking to integrate AspectJ and I've 
> experimented with Dagger2 so those would be the last pieces before I 
> can do the "real work".
>
> On Fri, Jun 30, 2017 at 5:46 AM, Kofford, C. Todd <tk...@ku.edu> wrote:
>
>> Ken, I'm glad to help!
>>
>> I tried to use the latest version of shiro (1.4.0) too, but ran into 
>> a some issues. I've posted a message to the shiro user group, and 
>> those guys are really good about getting back and resolving issues, 
>> so I think it's only a matter of time before that gets resolved.
>>
>> I've started another small project, still on shiro 1.3.2, that 
>> demonstrates how to define a custom shiro "realm", where you can do 
>> authentication and authorization. It's really pretty easy to 
>> implement, so it shouldn't take too long to crank out and post up to GitHub.
>>
>> Todd Kofford
>> tkofford@ku.edu
>>
>> -----Original Message-----
>> From: Ken McWilliams [mailto:ken.mcwilliams@gmail.com]
>> Sent: Thursday, June 29, 2017 1:25 PM
>> To: Struts Users Mailing List <us...@struts.apache.org>
>> Subject: Re: Integrate Apache Shiro with Struts2
>>
>> Todd, thank you this was a huge help!
>>
>> I've followed what you did and added it into a demo project that 
>> isn't much more complicated than what you provided, just so I know 
>> how it all works.
>>
>> One of the things I found the hard way is if you move to Shiro 1.4 
>> (the
>> latest) it won't start...
>>
>> I would like to turn your project into an struts2/shiro integration 
>> guide (although the provided project is quite straight forward). I'm 
>> using JPA services to get my user credentials so a bit of a guide 
>> there wouldn't hurt, so next step is to figure out how to make that work with shiro.
>>
>> Regards,
>> Ken
>>
>> On Mon, Jun 26, 2017 at 9:40 AM, Kofford, C. Todd <tk...@ku.edu> wrote:
>>
>> > OK, I've just uploaded a very simple struts2 - shiro example to github:
>> > https://github.com/tkofford/struts2shiro. NOTE - this is a very 
>> > simple example that uses a default shiro.ini file for 
>> > authentication/authorization and struts interceptor for "injecting" 
>> > the
>> shiro subject into the stack.
>> >
>> > I'll start building a more complicated example that uses spring to 
>> > inject the shiro parts, and reply back when that's done.
>> >
>> > Todd Kofford
>> > University of Kansas
>> > tkofford@ku.edu
>> >
>> > -----Original Message-----
>> > From: Ken McWilliams [mailto:ken.mcwilliams@gmail.com]
>> > Sent: Thursday, June 22, 2017 11:10 AM
>> > To: Struts Users Mailing List <us...@struts.apache.org>
>> > Subject: Re: Integrate Apache Shiro with Struts2
>> >
>> > That would be awesome. From having looked around on the web there 
>> > is very little Struts2/Shiro content. Some examples would be a great help.
>> >
>> > On Thu, Jun 22, 2017 at 9:51 AM, Kofford, C. Todd <tk...@ku.edu>
>> wrote:
>> >
>> > > We've been using strut2 and shiro for a long time (actually since 
>> > > the old jsecurity days). I'd be happy to contribute some trivial 
>> > > and more complex examples if needed.
>> > >
>> > > Todd Kofford
>> > > University of Kansas
>> > > tkofford@ku.edu
>> > >
>> > >
>> > > -----Original Message-----
>> > > From: Lukasz Lenart [mailto:lukaszlenart@apache.org]
>> > > Sent: Sunday, June 18, 2017 3:23 AM
>> > > To: Struts Users Mailing List <us...@struts.apache.org>
>> > > Subject: Re: Integrate Apache Shiro with Struts2
>> > >
>> > > 2017-06-17 19:08 GMT+02:00 Ken McWilliams <ke...@gmail.com>:
>> > > > If not I hope to follow up with a solution.
>> > >
>> > > +1 and we can add it to our docs :)
>> > >
>> > >
>> > > Regards
>> > > --
>> > > Łukasz
>> > > + 48 606 323 122 http://www.lenart.org.pl/
>> > >
>> > > -----------------------------------------------------------------
>> > > ---
>> > > - To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > > For additional commands, e-mail: user-help@struts.apache.org
>> > >
>> > >
>> >
>> > -------------------------------------------------------------------
>> > -- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>>
>>
>> --
>> Sent from my C64 using a 300 baud modem
>>
>
>
>
> --
> Sent from my C64 using a 300 baud modem

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org