You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by johnrellis <jo...@gmail.com> on 2016/04/06 17:03:05 UTC
Questions about "poor mans" SSO
Hey folks,
It looks as though "poor mans" Single Sign On is possible with Shiro using
native sessions with Ehcache and Terracotta.
This sounds good as all our apps are using Shiro so it is an avenue I would
like to explore. There is one problem though that is stopping me from
implementing this solution.
If I have two applications, AppOne and AppTwo
What happens if AppOne store com.john.appone.Person in the session and
AppTwo attempts to load that session? My guess is there would be a class
not found exception in AppTwo, would that be correct?
If so, is there any way around this?
I found a SO post which says to break up session but I'm not sure how
possible this is.
Many thanks,
John
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Questions about "poor mans" SSO
Posted by johnrellis <jo...@gmail.com>.
Thanks Brian,
I don't to confuse the situation with my hypothetical example
So some of the applications we use store POJOs in the session, it is
actually grails so it's something like session.person = new Person(whatever)
and this works with Shiro now as it stands using the in memory session
store.
The question I am asking is, if I then share this session with AppTwo via
Ehcache and AppTwo does not have a Person class, will there be issues when
AppTwo deserializes the session from the cache?
(Just to be sure I am not mixing up terminology, I am using the word session
to mean the session that is obtained from logging in and is referenced by
the JSESSIONID, the objects are stored in here so they are accessible after
a number of requests.)
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009p7581011.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Questions about "poor mans" SSO
Posted by Brian Demers <br...@gmail.com>.
Not sure i follow 100%, but, I think we might be mixing concerns here.
I'm guessing com.john.appone.Person is something application specific
right? and this is unrelated to your security session?
On Wed, Apr 6, 2016 at 11:03 AM, johnrellis <jo...@gmail.com> wrote:
> Hey folks,
>
> It looks as though "poor mans" Single Sign On is possible with Shiro using
> native sessions with Ehcache and Terracotta.
>
> This sounds good as all our apps are using Shiro so it is an avenue I would
> like to explore. There is one problem though that is stopping me from
> implementing this solution.
>
> If I have two applications, AppOne and AppTwo
>
> What happens if AppOne store com.john.appone.Person in the session and
> AppTwo attempts to load that session? My guess is there would be a class
> not found exception in AppTwo, would that be correct?
>
> If so, is there any way around this?
>
> I found a SO post which says to break up session but I'm not sure how
> possible this is.
>
> Many thanks,
> John
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
RE: Questions about "poor mans" SSO
Posted by johnrellis <jo...@gmail.com>.
Richard, thanks!
I didn't know those potential downsides of the ehcache solution, great info,
I'll investigate your suggestions!
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009p7581014.html
Sent from the Shiro User mailing list archive at Nabble.com.
RE: Questions about "poor mans" SSO
Posted by Richard Bradley <Ri...@softwire.com>.
> What happens if AppOne store com.john.appone.Person in the session and AppTwo attempts to load that session?
> My guess is there would be a class not found exception in AppTwo, would that be correct?
Yes
> If so, is there any way around this?
> I found a SO post which says to break up session but I'm not sure how possible this is.
The simplest fix will be to store only classes which all apps can understand in the Session.
You might be able to do something clever by overriding the serialization / deserialization code by providing a custom implementation of Session (see SimpleSession.readObject / SimpleSession.writeObject).
> It looks as though "poor mans" Single Sign On is possible with Shiro using native sessions with Ehcache and Terracotta.
I had a look at the Ehcache + Terracotta solution recently, and it looked to me like it would be very inefficient in practice, and it looked like it would not be remotely threadsafe. This might not be a problem if you have low traffic and you are sure that your users will only make one request at a time.
I ended up implementing a DB-backed "CachingSessionDAO" and removing Ehcache. I can't share the code here, sorry, but it wasn't very much work in the end.
GL
Rich
-----Original Message-----
From: johnrellis [mailto:john.d.rellis@gmail.com]
Sent: 06 April 2016 16:03
To: user@shiro.apache.org
Subject: Questions about "poor mans" SSO
Hey folks,
It looks as though "poor mans" Single Sign On is possible with Shiro using native sessions with Ehcache and Terracotta.
This sounds good as all our apps are using Shiro so it is an avenue I would like to explore. There is one problem though that is stopping me from implementing this solution.
If I have two applications, AppOne and AppTwo
What happens if AppOne store com.john.appone.Person in the session and AppTwo attempts to load that session? My guess is there would be a class not found exception in AppTwo, would that be correct?
If so, is there any way around this?
I found a SO post which says to break up session but I'm not sure how possible this is.
Many thanks,
John
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009.html
Sent from the Shiro User mailing list archive at Nabble.com.
Richard Bradley
Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575
softwire
Sunday Times Best Small Companies - UK top 25 six years running
Web : www.softwire.com<http://www.softwire.com/> | Follow us on Twitter : @SoftwireUK<https://twitter.com/SoftwireUK>
Addr : 110 Highgate Studios, 53-79 Highgate Road, London NW5 1TL
Softwire Technology Limited. Registered in England no. 3824658. Registered Office : Gallery Court, 28 Arcadia Avenue, Finchley, London. N3 2FG
Re: Questions about "poor mans" SSO
Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I would use Hazelcast instead of EhCache / Terracotta,
it’s much easier to set up, more modern / leaner etc.
> On Apr 9, 2016, at 4:19 AM, johnrellis <jo...@gmail.com> wrote:
>
> Thanks sc Synergy,
>
> Yeah web applications deployed using tomcat clustering.
>
> Thanks for the suggestion, it sounds like an easy way to achieve SSO, I'll
> investigate it's feasibility with the cluster of applications we're working
> with.
>
> Is terracotta required if apps are clustered on different servers?
>
>
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009p7581015.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
Re: Questions about "poor mans" SSO
Posted by johnrellis <jo...@gmail.com>.
Thanks folks!
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009p7581018.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Questions about "poor mans" SSO
Posted by scSynergy <ro...@scsynergy.de>.
If applications reside on different cluster nodes, then yes, you will need
either terracotta or hazelcast.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009p7581017.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Questions about "poor mans" SSO
Posted by johnrellis <jo...@gmail.com>.
Thanks sc Synergy,
Yeah web applications deployed using tomcat clustering.
Thanks for the suggestion, it sounds like an easy way to achieve SSO, I'll
investigate it's feasibility with the cluster of applications we're working
with.
Is terracotta required if apps are clustered on different servers?
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009p7581015.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Questions about "poor mans" SSO
Posted by scSynergy <ro...@scsynergy.de>.
Are we talking web applications here or not? Because, if we are talking about
web applications hosted on an application server, then you can have the
application server supply the required class 'com.john.appone.Person'
instead of packaging it along with the application. This way any web
application on that server has access to the required class.
On Wildfly e. g. we put the following files in
[WILDFLY_HOME]/modules/org/apache/camel/main:
camel-core-2.17.0.jar
module.xml
so that all our web applications have access to the same instances of Apache
Camel.
By the way, in this scenario you do not need terracotta for SSO, ehcache is
enough.
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Questions-about-poor-mans-SSO-tp7581009p7581013.html
Sent from the Shiro User mailing list archive at Nabble.com.