[keycloak-dev] Authz Model Implementation

Stian Thorgersen sthorger at redhat.com
Mon Oct 19 02:33:58 EDT 2015


On 16 October 2015 at 21:19, Pedro Igor Silva <psilva at redhat.com> wrote:

> I'm not saying it does not work, but in my case I have a specific module
> with all the authz stuff. There I'm already using Spis from KC such as
> JpaConnectionProvider, extension to admin rest api, etc. That is fine and
> everything is perfect.
>
> The problem I'm facing is how to tell KC to load Spis from my module
> without change a bit in KC modules or change code. If you see
> org.keycloak.services.DefaultKeycloakSessionFactory#init, Spis are loaded
> from getClass().getClassLoader(). Considering that my Spis are in a
> different classloader, they will never be loaded.
>
> A simple solution for that would be to do something similar as when
> loading providers, so you could also consider the classloaders from the
> providers when loading Spis.
>

That works - we should be able to look in modules and classpath entries for
SPIs like we do for providers. Prepare a PR and we'll merge it.


>
> ----- Original Message -----
> From: "Bill Burke" <bburke at redhat.com>
> To: keycloak-dev at lists.jboss.org
> Sent: Friday, October 16, 2015 2:18:22 PM
> Subject: Re: [keycloak-dev] Authz Model Implementation
>
>
>
> On 10/16/2015 9:07 AM, Pedro Igor Silva wrote:
> > Yeah, I've talked with Bolek as well and we discussed about focusing on
> JPA (which I was already using) for now, but still provide a SPI for future
> implementations.
> >
> >>From a SPI perspective, I did something very simple without KC's
> org.keycloak.provider.Spi. The main reason for this decision is that Spis
> in KC are not loaded when defined within a custom provider and I'm trying
> to minimize changes in KC itself.
> >
>
> How could the org.keycloak.provider.Spi not work?  It uses the
> META-INF/services pattern to locate new and old Spis.  Nothing magical
> there.  Your jar just needs to be loaded into the appropriate modules.
>
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20151019/8a9d302a/attachment-0001.html 


More information about the keycloak-dev mailing list