[keycloak-dev] Improve search by a specific user in the admin console

Stan Silvert ssilvert at redhat.com
Thu Jan 31 07:46:43 EST 2019


This has always been a sore spot.  I expect that we will address it when 
we rewrite the admin console, which is in the plan but we don't have a 
timeline yet.

Another approach for now would be to write a standalone java app that 
uses the keycloak-admin-client to find the user id.  Then it opens that 
user in the browser.  This way, you could use it with any keycloak server.

On 1/31/2019 7:21 AM, Alexis Almeida wrote:
> Considering an instalation of Keycloak where there are 2mi (or more) of
> users on user_entity table, search for a specific user on the console is a
> stressing task if you do it several times a day. I think it should be
> possible to do "direct" search by username.
>
> Today it is possible to search for a specific user by ID, by typing
> id:xxxxxx in the search field in the console. IMO this feature could be
> expanded, so someone could search for a specific user by username or by
> email, like this: username:xxxxx or email:xxxxxx.
>
> I made this change on my local machine and the result was ok.
>
> private static final String SEARCH_USERNAME_PARAMETER = "username:";
> private static final String SEARCH_EMAIL_PARAMETER = "email:";
> .
> .
> .
> } else if (search.startsWith(SEARCH_USERNAME_PARAMETER)) {
>      UserModel userModel =
> session.users().getUserByUsername(search.substring(SEARCH_USERNAME_PARAMETER.length()).trim(),
> realm);
>      if (userModel != null) {
>          userModels = Arrays.asList(userModel);
>      }
> } else if (search.startsWith(SEARCH_EMAIL_PARAMETER)) {
>      UserModel userModel =
> session.users().getUserByEmail(search.substring(SEARCH_EMAIL_PARAMETER.length()).trim(),
> realm);
>      if (userModel != null) {
>         userModels = Arrays.asList(userModel);
>      }
> } else {
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev




More information about the keycloak-dev mailing list