Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
Describe the issue:
The following query is executed 4-5 times per single authentication request despite the UserIDCache is there.
SELECT UM_USER_ID FROM UM_USER WHERE LOWER(UM_USER_NAME)=LOWER(?) AND UM_TENANT_ID=?
Due to two issues, it causes cache misses and executes above query multiple times.
The UserManagementAuditLogger is trying to get the user id of the initiator, but for some events the initiator is "wso2.system.user"
The authenticatedSubjectIdentifier of the user included in AUTHENTICATION_SUCCESS event is an UUID, not the username. So AuthenticationAuditLoggerUtils is trying to get user id of an UUID
Steps to reproduce
Put a breakpoint into beginning of doGetUserIDFromUserNameWithID method in UniqueIDJDBCUserStoreManager
Try to login to MyAccount and observe the userName parameter value
Describe the issue: The following query is executed 4-5 times per single authentication request despite the UserIDCache is there.
Due to two issues, it causes cache misses and executes above query multiple times.
Steps to reproduce
doGetUserIDFromUserNameWithID
method inUniqueIDJDBCUserStoreManager
Environment information