[keycloak-user] Stateful per-realm objects

Marek Posolda mposolda at redhat.com
Fri Jan 20 03:28:34 EST 2017


LoginProtocolFactory is shared per KEycloakSessionFactory and defacto it 
is something like singleton. So yu can have that object (or per-realm 
Map of those objects) in your LoginProtocolFactory implementation? Then 
during each request, you will just pass the particular object to your 
LoginProtocol or ProtocolEndpoint impl?

Marek

On 19/01/17 18:23, Dmitry Telegin wrote:
> Hi,
>
> A new login protocol endpoint instance is created each time per-
> request (o.k.protocol.LoginProtocolFactory::createProtocolEndpoint). I
> need all the instances to have access to a shared, per-realm stateful
> object.
> (Background: I'm implementing OpenID 2.0 for Keycloak using openid4java
> library. There, the central concept is ServerManager, a per-endpoint
> singleton that stores cryptographic associations and other shared
> data.)
>
> Just wondering if there's already similar mechanism in Keycloak. It
> shouldn't be that hard to implement a singleton registry, but it'd
> prefer not to reinvent the wheel.
>
> Thanks!
> Dmitry
> _______________________________________________
> 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