[keycloak-dev] Preferred storage mechanism for custom settings

Dmitry Telegin mitya at cargosoft.ru
Mon Jul 18 16:35:46 EDT 2016


Stian,

Here we go: https://issues.jboss.org/browse/KEYCLOAK-3327

If the fix is somewhat trivial (i.e. a matter of adding fields and
getters/setters) I think I could work on a PR as well.

BTW, does this mean that all the custom entities provided via Entity
SPI are not by default cache-enabled (and won't be synchronized between
the nodes in clustered environment)?
If so, will it be easy to cache-enable them? Is this just a matter of
providing Infinispan adapters similar to existing ones for
Realm/User/Role/Client etc.?

Ideally, I'd like to see a current domain-extension example augmented
with Infinispan cache functionality. I've got some ideas on a detailed
walkthrough tutorial for building complete, full-featured KeyCloak
extensions (it's a big topic I'll elaborate on a bit later); I think
Infinispan-enabled entities could be covered there, too.

Regards,
Dmitry

В Пн, 18/07/2016 в 07:39 +0200, Stian Thorgersen пишет:
> > > > Forgot that attributes are not exposed through RealmModel. You can't
access the JPA RealmAdapter directly as you'll break the cache
functionality. You can create a JIRA to request attributes added to
RealmModel though.
> 
> > On 15 July 2016 at 20:28, Mitya <mitya at cargosoft.ru> wrote:
> > Stian,
> > > > > > > > > > In my provider, session.getContext().getRealm() returns an instance
of org.keycloak.models.cache.infinispan.RealmAdapter. But in order
to be able to manage attributes, we need an
org.keycloak.models.jpa.RealmAdapter. What's the best way to obtain
it?
> > 
> > I've yet come up with the following:
> > 
> > RealmModel realm = session.getContext().getRealm();
> > > > RealmAdapter adapter = (RealmAdapter)
session.getProvider(RealmProvider.class).getRealm(realm.getId());
> > 
> > 
> > > Realm attributes should be perfect for that
> > > > > > On 12 July 2016 at 13:42, Mitya <mitya at cargosoft.ru> wrote:
> > > > Hi,
> > > > > > > > > > > > > > > > > > > > I'm developing a KeyCloak extension, and I want some custom
(per-realm) parameters to be tuned via the GUI form. Speaking
of the storage mechanism for my settings, are realm attributes
suitable for that? or should I create a dedicated custom entity
instead?
> > > > 
> > > > Thx,
> > > > Mitya
> > > > 
> > > > 
> > > > _______________________________________________
> > > > 
> > > > 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/20160718/0b80a7a6/attachment.html 


More information about the keycloak-dev mailing list