[keycloak-user] Realm lookup from Realm ID (not realm name)

Dmitry Telegin dt at acutus.pro
Thu Feb 7 12:05:00 EST 2019


Hello Ian,

Please try this:

session.realms().getRealm(id).getName();

KeycloakSession is available in the factory, so you should pass it to the provider instance e.g. via constructor argument.

Cheers,
Dmitry Telegin
CTO, Acutus s.r.o.
Keycloak Consulting and Training

Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
+42 (022) 888-30-71
E-mail: info at acutus.pro

On Thu, 2019-02-07 at 16:36 +0000, Ian Duffy wrote:
> Hi All,
> 
> I'm using an Event SPI to publish create user keycloak events into ActiveMQ.
> 
> These events consumed and stored into another service that allows for realm
> to username/email mappings.
> 
> The Event payload contains the Realm ID (a UUID) rather than the Realm
> Name. I'm not seeing any way to query the realm through the API via Realm
> ID. Is there an approach for converting Realm ID to Realm Name?
> 
> Thanks,
> Ian.
> _______________________________________________
> 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