Create a client and getting a JWT token with cUrl

This blog post shows how to create a user and client using the UI and then how to obtain a JWT using cUrl. I need to automate this process using cUrl without the UI. I have cUrl commands to create a realm and a user. I haven’t been able to find cUrl commands to create the client, though. Are the cUrl commands available for creating a client as in this article?

You have available REST API https://www.keycloak.org/docs-api/11.0/rest-api/index.html which is used by your “curl commands”. So you can also create and manage clients via this API. Even UI uses this API, so you can see correct requets and payloads in your browser network developer console. Then you can just mimic them with the curl.

Unfortunately I’ve found the docs to be worthless. The doc for ClientRepresentation shows all fields to be optional. Nothing is required? It shows access to be a Map of some sort but that link is incorrect.

@dwschulze as @jangaraj mentioned you can use the (browser’s) Developer Tools to inspect the interaction between the Keycloak’s Admin Console and Keycloak’s API.

Ref: Getting started with Keycloak