mirror of
https://github.com/keycloak/keycloak.git
synced 2026-05-26 13:50:48 +00:00
8b357d610a
- Introduce UserSearchPrefix enum in SearchQueryUtils pairing each prefix (id:, username:, email:) with its UserProvider lookup, plus a splitTerms helper backed by a precompiled "\\s+" pattern - Collapse duplicate prefix branches in UsersResource#getUsers, UsersResource#getUsersCount and BruteForceUsersResource#searchUser - BruteForceUsersResource: support multi-term lookups (e.g. "username:foo bar"), aligning with UsersResource - Tests: add searchByUsernameSearch / searchByEmailSearch covering single-term, multi-term and whitespace-tolerant variants - Docs: add "Search by fields" section to proc-searching-user.adoc Fixes #26602 Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
52 lines
2.2 KiB
Plaintext
52 lines
2.2 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// server_admin/topics/users.adoc
|
|
|
|
[id="proc-searching-user_{context}"]
|
|
= Searching for a user
|
|
|
|
Search for a user to view detailed information about the user, such as the user's groups and roles.
|
|
|
|
.Prerequisite
|
|
* You are in the realm where the user exists.
|
|
|
|
== Default search
|
|
|
|
.Procedure
|
|
. Click *Users* in the main menu. This *Users* page is displayed.
|
|
. Type the full name, last name, first name, or email address of the user you want to search for in the search box. The search returns all users that match your criteria.
|
|
+
|
|
The criteria used to match users depends on the syntax used on the search box:
|
|
+
|
|
.. `"somevalue"` -> performs exact search of the string `"somevalue"`;
|
|
.. `\*somevalue*` -> performs infix search, akin to a `LIKE '%somevalue%'` DB query;
|
|
.. `somevalue*` or `somevalue` -> performs prefix search, akin to a `LIKE 'somevalue%'` DB query.
|
|
|
|
== Search by fields
|
|
|
|
{project_name} supports direct user lookups for selected fields by prefixing the search term in the search box:
|
|
|
|
* `id:myUUID` -> performs an exact user lookup by id for `"myUUID"`;
|
|
* `username:myuser` -> performs an exact user lookup by username for `"myuser"`;
|
|
* `email:myuser@domain.org` -> performs an exact user lookup by email for `"myuser@domain.org"`.
|
|
|
|
Multiple values can be supplied separated by whitespace (for example `id:uuid1 uuid2`) to look up several users in a single request.
|
|
|
|
== Attribute search
|
|
|
|
.Procedure
|
|
. Click *Users* in the main menu. This *Users* page is displayed.
|
|
. Click *Default search* button and switch it to *Attribute search*.
|
|
. Click *Select attributes* button and specify the attributes to search by.
|
|
. Check *Exact search* checkbox to perform exact match or keep it unchecked to use an infix search for attribute values.
|
|
. Click *Search* button to perform the search. It returns all users that match the criteria.
|
|
|
|
|
|
[NOTE]
|
|
====
|
|
Searches performed in the *Users* page encompass both {project_name}'s database and configured user federation backends, such as LDAP. Users found in federated backends will be imported into {project_name}'s database if they don't already exist there.
|
|
====
|
|
|
|
.Additional Resources
|
|
* For more information on user federation, see <<_user-storage-federation,User Federation>>.
|