[keycloak-user] Show Username in Admin Events / Login Events

Guido Wimmel guido_99 at gmx.de
Thu May 16 15:06:30 EDT 2019


Hi Huw,

thank you very much for the helpful advice.

The event listener would be able to get the real user names - but
probably the Admin Console would have to be extended somehow to make the
user names appear in the Admin Events view?

BTW, the solution for the second question (seeing which roles were
added/removed) is simple - just turning on "Include Representation".
Sorry for overlooking this.

Best regards,
    Guido

Am 13.05.19 um 20:07 schrieb Huw McNamara:
> Hi Guido,
>
> One possible way you could achieve what you want is to implement a
> custom event listener. See
> https://github.com/zekidkiller/keycloak/tree/master/examples/providers/event-listener-sysout for
> an example.
>
> Then using a combination of the API
> https://www.keycloak.org/docs-api/6.0/rest-api/index.html#_users_resource and/or
> Keycloak classes
> https://www.keycloak.org/docs-api/6.0/javadocs/org/keycloak/storage/user/UserLookupProvider.html#getUserById-java.lang.String-org.keycloak.models.RealmModel- you
> should be able to get real values for IDs.
>
> The easiest way might be the API as it is very frequently a 1-1
> mapping for any resource path (given in the event details).
>
> Kind regards,
> Huw
>
> ------------------------------------------------------------------------
> *From:* keycloak-user-bounces at lists.jboss.org
> <keycloak-user-bounces at lists.jboss.org> on behalf of Guido Wimmel
> <guido_99 at gmx.de>
> *Sent:* 08 May 2019 20:04
> *To:* keycloak-user at lists.jboss.org
> *Subject:* Re: [keycloak-user] Show Username in Admin Events / Login
> Events
> Hi,
>
> does anyone possibly have similar concerns / a workaround? The Admin
> Events View
> in the Administration Console is of limited use for our Keycloak admins
> if they have to lookup
> the usernames of the concerned users.
>
> In addition, it seems that the Admin Events do not contain information
> on which role(s)
> were assigned to / removed from a user - I can only see a general update
> of the
> client-role-mapping.
> Is this true? Is there a way to extend the Admin Events such that it is
> possible to see which role(s) were
> added/removed?
>
> Thanks in advance, best regards,
>    Guido
>
> On 06.04.19 10:39 Guido Wimmel wrote:
> > Hi,
> >
> > in the Admin Events / Login Events - View in the Administration Console
> > in Keycloak, I can see e.g. if users logged in or were assigned to a
> role.
> > However, the users are only referenced by their id.
> >
> > I can determine the username by constructing an URL (e.g.
> > .../realms/<MY_REALM>/users/<UserId> ) and navigating to it.
> >
> > Is there an easier way?
> >
> > Best regards,
> >      Guido
> >
> > _______________________________________________
> > 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