[keycloak-user] user storage provider (Keycloak 2.5.0) deployed as war file: CDI does not work

Matuszak, Eduard eduard.matuszak at worldline.com
Thu Jan 26 06:36:29 EST 2017


Hello
In any case, it seems not to be a trivial task. I adhered to Bill's suggestions and additionally did some expirimental attempts but without success.
It's not a critical topic for me as I can live and work without CDI. Anyhow thanks for your comments.
Eduard

-----Original Message-----
From: keycloak-user-bounces at lists.jboss.org [mailto:keycloak-user-bounces at lists.jboss.org] On Behalf Of Stian Thorgersen
Sent: Tuesday, January 24, 2017 8:50 AM
To: Bill Burke
Cc: keycloak-user
Subject: Re: [keycloak-user] user storage provider (Keycloak 2.5.0) deployed as war file: CDI does not work

I'm pretty sure CDI just won't work. When we invoke the provider from Keycloak it doesn't setup the CDI context as it's not a managed request to the deployment so the necessary CDI filters and such are not invoked.

On 19 January 2017 at 16:01, Bill Burke <bburke at redhat.com> wrote:

> How exactly are you implementing it?  Can you point me to some example 
> code?  Remember, UserStorageProviderFactory *MUST* be a POJO.  I 
> haven't done CDI in years, but I believe it would work similarly to 
> the EJB example, except you'd look up the CDI bean manager and 
> allocate your provider through the bean manager.
>
>
> On 1/19/17 5:36 AM, Matuszak, Eduard wrote:
> > Hello
> >
> > It is not possible for me, to bring CDI (@Inject) to work in a user
> storage provider application (Keycloak 2.5.0), deployed as a war-file. 
> The required beans.xml is placed correctly in the war-file and passed 
> by Weld during deployment, but all injected objects are null.
> >
> > Is this a known (and possibly perforced) behaviour,  a (minor) bug 
> > or
> simply due to a missing trick?
> >
> > Thanks in advance for a feedback, Eduard Matuszak
> >
> >
> > _______________________________________________
> > keycloak-user mailing list
> > keycloak-user at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-user
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
_______________________________________________
keycloak-user mailing list
keycloak-user at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user



More information about the keycloak-user mailing list