You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ClientsResource.findByClientId(String) should return a single item #39851
We have such a method org.keycloak.admin.client.resource.ClientsResource.findByClientId(String) that should return a single item, but it returns a List of ClientRepresentation.
Discussion
No response
Motivation
Cleaner, more readable, removing ambiguity
Details
We have such a method org.keycloak.admin.client.resource.ClientsResource.findByClientId(String) that should return a single item, but it returns a List of ClientRepresentation, We should note that clientId is unique, so it creates ambiguity. As an enhancement, it's nice to have a method like this:
By adding this, we should mark this method as deprecated List<ClientRepresentation> findByClientId(@QueryParam("clientId") String clientId);
Since org.keycloak.admin.client.resource.ClientsResource is an interface, probably we need to create a new method in org.keycloak.services.resources.admin.ClientsResource to return ClientRepresentation
This enhancement makes it easier to understand since it will just do this job, also, we can have a better error handling for a single record by throwing errors like {NOT_FOUND, BAD_REQUEST, FORBIDDEN}
I'm preparing a pull request for this change if this enhancement gets approved by a comment
I understand the goal is to refactor findByClientId to return a single item (or Optional) since client IDs are unique, removing the ambiguity of returning a List.
I will analyze the current implementation in ClientsResource and submit a PR. Please assign this to me
Activity
Client Resource must return a single item (keycloak#39851)
Client Resource must return a single item (keycloak#39851)
Client Resource must return a single item (keycloak#39851)
Abhikaravate commentedon Jan 28, 2026
Hi maintainers,
I would like to work on this issue.
I understand the goal is to refactor findByClientId to return a single item (or Optional) since client IDs are unique, removing the ambiguity of returning a List.
I will analyze the current implementation in ClientsResource and submit a PR. Please assign this to me
shawkins commentedon Jan 28, 2026
@Abhikaravate thank you for your interest, but there is already a PR open for this issue.
shawkins commentedon Mar 13, 2026
Marking as out-of-date - an attempt at a PR did not garner sufficient interest for inclusion.