You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by charlieqiu <qc...@gmail.com> on 2012/11/14 03:35:59 UTC
Re: Subject / SecurityManager that is dependent on a
non-"global"/thread-scoped object
Hi,
I have similar use case with you. I have to create realms according to user
requests with many securityManager instances. In your case you may try
register all possible realms into a global SecurityManager. Then override
the method 'public boolean supports(AuthenticationToken token)' in each
Realm.
you can use 'public boolean supports(AuthenticationToken token)' to
determine whether a commandSession will be authenticated withing a realm.
Charlie
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Subject-SecurityManager-that-is-dependent-on-a-non-global-thread-scoped-object-tp7577892p7577931.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Subject / SecurityManager that is dependent on a
non-"global"/thread-scoped object
Posted by Charlie Qiu <qc...@gmail.com>.
You are welcome Hendy.
So during login, the login form must provide a AuthenticationToken subclass
that not only provides username + password but also the realm name (i.e.
tenant) ?<=====
Yes, that's what I mean. Then you can verify the realm name in 'public
boolean support(AuthenticationToken token)'
BTW you also said "many securityManager instances", how do you manage this
one ?<=====
I did this by constructing DefaultSecutityManager and its subclasses with
Spring scope "prototype" which calls 'new DefaultSecurityManager()'
actually. I disabled session and subjectDao in the SecurityManager to avoid
conflicts(which I am still testing ). I have to do so because I have to
integrate my own subject-related resource into realms so I have to create
realms dynamically.
2012/11/14 Hendy Irawan <he...@soluvas.com>
> Thank you Charlie.
>
> It seems like a reasonable workaround.
>
> So during login, the login form must provide a AuthenticationToken subclass
> that not only provides username + password but also the realm name (i.e.
> tenant) ?
>
> It makes sense. And if it works with your case, then I feel relieved. :-)
> Thanks again :)
>
> BTW you also said "many securityManager instances", how do you manage this
> one ?
>
> Hendy
>
> On Wed, Nov 14, 2012 at 9:36 AM, charlieqiu [via Shiro User] <
> ml-node+s582556n7577931h39@n2.nabble.com> wrote:
>
> > Hi,
> >
> > I have similar use case with you. I have to create realms according to
> > user requests with many securityManager instances. In your case you may
> try
> > register all possible realms into a global SecurityManager. Then
> override
> > the method 'public boolean supports(AuthenticationToken token)' in each
> > Realm.
> > you can use 'public boolean supports(AuthenticationToken token)' to
> > determine whether a commandSession will be authenticated withing a realm.
> >
> > Charlie
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://shiro-user.582556.n2.nabble.com/Subject-SecurityManager-that-is-dependent-on-a-non-global-thread-scoped-object-tp7577892p7577931.html
> > To unsubscribe from Subject / SecurityManager that is dependent on a
> > non-"global"/thread-scoped object, click here<
> http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7577892&code=aGVuZHlAc29sdXZhcy5jb218NzU3Nzg5MnwxNTI0Njc4NzUy
> >
> > .
> > NAML<
> http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
> --
> Hendy Irawan - on Twitter <http://twitter.com/hendybippo> - on
> LinkedIn<http://id.linkedin.com/in/hendyirawan>
> Web Developer | Bippo Indonesia <http://www.bippo.co.id/> | Akselerator
> Bisnis | Bandung
>
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Subject-SecurityManager-that-is-dependent-on-a-non-global-thread-scoped-object-tp7577892p7577932.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
Re: Subject / SecurityManager that is dependent on a
non-"global"/thread-scoped object
Posted by Hendy Irawan <he...@soluvas.com>.
Thank you Charlie.
It seems like a reasonable workaround.
So during login, the login form must provide a AuthenticationToken subclass
that not only provides username + password but also the realm name (i.e.
tenant) ?
It makes sense. And if it works with your case, then I feel relieved. :-)
Thanks again :)
BTW you also said "many securityManager instances", how do you manage this
one ?
Hendy
On Wed, Nov 14, 2012 at 9:36 AM, charlieqiu [via Shiro User] <
ml-node+s582556n7577931h39@n2.nabble.com> wrote:
> Hi,
>
> I have similar use case with you. I have to create realms according to
> user requests with many securityManager instances. In your case you may try
> register all possible realms into a global SecurityManager. Then override
> the method 'public boolean supports(AuthenticationToken token)' in each
> Realm.
> you can use 'public boolean supports(AuthenticationToken token)' to
> determine whether a commandSession will be authenticated withing a realm.
>
> Charlie
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Subject-SecurityManager-that-is-dependent-on-a-non-global-thread-scoped-object-tp7577892p7577931.html
> To unsubscribe from Subject / SecurityManager that is dependent on a
> non-"global"/thread-scoped object, click here<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7577892&code=aGVuZHlAc29sdXZhcy5jb218NzU3Nzg5MnwxNTI0Njc4NzUy>
> .
> NAML<http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
Hendy Irawan - on Twitter <http://twitter.com/hendybippo> - on
LinkedIn<http://id.linkedin.com/in/hendyirawan>
Web Developer | Bippo Indonesia <http://www.bippo.co.id/> | Akselerator
Bisnis | Bandung
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Subject-SecurityManager-that-is-dependent-on-a-non-global-thread-scoped-object-tp7577892p7577932.html
Sent from the Shiro User mailing list archive at Nabble.com.