Le lundi 08 février 2010 12:43:15, Niclas Hedhman a écrit :
> On Mon, Feb 8, 2010 at 7:33 PM, Paul Merlin <[email protected]> wrote:
> > Now, I plan to write a custom Shiro Realm for my app, and will try to
> > extract a sort of AbstractQi4jRealm. It should provide boilerplate code
> > for implementing custom Realms loading authc & authz data from qi4j
> > Entities, whatever the domain model you have.
>
> Excellent. If you need assistance, don't hesitate to ask.
Hi Niclas,
In fact I already have questions in mind, let me phrase them so they will be
clearer to me and if you have any advice
you can give it to me.
Shiro use a .ini config file where you can put the FQN of a class implementing
the Realm interface or the FQN of class
implementing RealmFactory. So that's Shiro that's responsible for the
instanciation. The way to go seems to be the
RealmFactory so we have control over the Realm instanciation.
Here is the RealmFactory interface declaration :
public interface RealmFactory {
Collection<Realm> getRealms();
}
If the realm is a ServiceComposite for example, the RealmFactory needs to have
access to a ServiceFinder. What I did for
now is using a static field refering to an Application in my RealmFactory that
is set by the ServletContextListener who
bootstrap my Application. That feels both innapropriate and is tied to the
webapp context.
I currently have no other idea but did not dig deeper. Did you come accross
good ways to handle this kind of integration
?
Paul
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev