How to get user name by id in the EventListenerProvider
#29232
-
hi The implementation works well except that i need a user name rather than
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
What if the user has no username or changes their username? What if the user uses their email as their username, then changes the email? The only attribute that cannot be changed is their id, which should be used to avoid leaking private information and facilitating the existence of untrackable logs and bugs. Either way, if you're doing so for learning purposes, here are two a quick implementations from ChatGPT-4 and Google's Gemini. I haven't tested them, but considering the methods they used I believe it should work. |
Beta Was this translation helpful? Give feedback.
-
the AdminEvent doesn't have |
Beta Was this translation helpful? Give feedback.
-
@missedone Hi, I'm having similar kind of situation, Can you please help how did you resolve this. I have enabled the keycloak event logs by using ENV variable "KC_SPI_EVENTS_LISTENER_JBOSS_LOGGING_SUCCESS_LEVEL" with value "info" I would like to add a new custom attribute "appName" to the above logs, as I'm sending these logs to some other external tool which is expecting "appName" along with other attributes like realmId, clientId, userId, ipAddress etc in the above logs. We are mentioning our application name in client description while creating client in realm. so I would like to pass this client description to the attribute "appName" and that would be to be added to above event logs. Can you please help me how do I achieve adding custom attribute to the event logs? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
True. Have you tried implementing the create method from EventListenerProviderFactory?