What is not working well with the current Admin APIs? #37655
Replies: 10 comments 11 replies
-
Here's my list:
Now connecting this a bit to other things like Other things that are relevant is for example there are separate projects on how to declaratively configure KC, that basically wraps our endpoints in different APIs just to achieve better usability. In the new test framework we're also seeing a lot of the above issues, where it can be pretty hard to use the Java Admin client and know how to configure specific things again protocol mappers is a good example of something that is rather hard. Other issues seen are for example the ID returned in the location header; the fact that you have to use IDs returned by the server rather than things you defined yourself to lookup resources later; and last, but not least the issue with POST vs PUT and not nothing have that behaves, and having to try out if after defining a resource and creating or updating it if everything was actually updates as expected or not, or if you have to turn to separate calls for some bits. |
Beta Was this translation helpful? Give feedback.
-
Some additional thoughts from the perspective of declarative config (some were already touched above):
|
Beta Was this translation helpful? Give feedback.
-
Adding something that came up today as an issue. In Admin V1 it's often not possible to set a value back to We use PUT as a PATCH; PUT should really be make it like this, while PATCH is change these things. Further, we don't know if As an example on how I envision a PATCH working properly:
The above should set the displayName to
Not sure if Jackson/RestEasy has some mechanism so we could find out if a |
Beta Was this translation helpful? Give feedback.
-
Inconsistency in naming of classes and methods ADMIN REST interface for test usage: Keycloak ADMIN API: Small example - update user: |
Beta Was this translation helpful? Give feedback.
-
Maybe it's related to the implementation of the API rather than its interface, yet I'll add this: we face performance problems when we load users from Keycloak via pagination in case the User federation (with LDAP) is enabled |
Beta Was this translation helpful? Give feedback.
-
There are different return values for the Admin client for testing:
Unhandled Responses are causing concurrent failures in the ConcurrencyTest when calling REST API -> deadlocks. |
Beta Was this translation helpful? Give feedback.
-
Not directly related to the proposed refactoring but I just filed #39281 . Perhaps during the refactoring, you can extend test coverage to ensure that various combinations of parameters are exercised together to ensure there are no edge cases that are accidentally unsupported? |
Beta Was this translation helpful? Give feedback.
-
The documentation. For example, I am trying to data for a given client (to manually generate XML/PEM files, since there's no way via the REST api to download them, as you can within the web API), and this requires that you know what the id of the client is. Nowhere in the API documention does it mention that you can just do a GET on /admin/realm/realmname/clients/ and get a full list. Nor does it say that you can search for a client by name by hitting /auth/admin/realms/$REALM_NAME/clients?clientId=$CLIENT_ID Nowhere in the documentation does it say how to do things using the admin API such as "create a new SAML client". The description for creating a client only mentions that you need to set a ClientRepresentation, and goes into no detail about what the mysterious "Attributes" block is. There are no examples of how to make your initial request -- how to acquire an auth token and use it in subsequent requests with (for example) wget or LWP or curl and jq. Maybe these are things that someone who has written a rest client has worked with before, maybe they aren't. There could certainly be, at least, pointers to better resources for using REST in general. I've asked on the forumsif it's possible via the rest api to import a client using a saml sp-metadata.xml file, but with no responses. |
Beta Was this translation helpful? Give feedback.
-
Having null (and also not set) meaning that a default value is used is
fine.... as long as the GET operation of the resource does preserve this
and also returns null. Only internally the default should be applied. (An
additional read-only resource could provide the defaults, to show them in
configuration UIs like the admin console).
Using "default" as value resources end up with all properties required:
{
a: "default",
b: "default",
someKeyWithoutDefault: "foo",
d: "default"
}
It would be nicer to allow PUT:
{
someKeyWithoutDefault: "foo"
}
GET of this resource must return the same or at least
{
a: null,
b: null,
someKeyWithoutDefault: "foo"
d: null
}
consooo ***@***.***> schrieb am Mi., 21. Mai 2025, 09:50:
… Having empty strings or null values as defaults is generally problematic.
When using terraform for instance, lots of variables for clients are set
via map. Terraform goes into an infinite reconciliation loop when setting
keys with empty values, and not setting these keys will not set the values
to default.
Is it feasable to have some constant like "DEFAULT" set instead of empty
strings to make management via terraform and crossplane simpler?
—
Reply to this email directly, view it on GitHub
<#37655 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGAX6GADJDCTG2H3753IOL27QV33AVCNFSM6AAAAABX4U4DMWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMRRGY3DOMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
One limitation in the current Admin APIs is the lack of efficient ways to fetch hierarchical and related data. For example, retrieving all users within a group subtree along with their role and group mappings currently requires:
With n being the number of users, the total number of HTTP requests is O(n) (specifically 2n + 1), which becomes a performance and scalability bottleneck in larger realms. Possible solutionConsider introducing API endpoints that support embedding related entities or batch-fetching group- and role-mappings in bulk. This would drastically reduce the number of requests and make the API far more usable for automation and integration. Appreciate the effort going into the new API design. Really looking forward to a more efficient and developer-friendly Admin API v2! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As part of designing new Admin APIs we are defining REST API guidelines for Keycloak. The aim is to eventually provide a much better and improved Admin API v2.
We will eventually break down API guidelines into distinct areas to discuss further in separate discussions. This discussion is mainly about gathering information of what problems exists with the current APIs.
Beta Was this translation helpful? Give feedback.
All reactions