How to create client secret via API

I’m using keycloak version 20.0.2, i want to know if it possible to provide clientSecret through the post request (/admin/realms/:realm/clients/:id/client-secret).
please provide body if possible

URI: https://{host}/auth/admin/realms/{realm}/clients/{clientId}/client-secret

Body: {}

Response: {type: "secret", value: "cwhGiDrvwQDIrbFSrYKVEioMhbK63r8i"}

This endpoint is for the old version I’m using version 20.0.2, and I want to send body to post request with my own generated client secret value


Body: {
“clientSecret”:“my own generated value here”

Response: {
type: “secret”,
value: “my own generated value here”

This is my expectation

Sadly, expectations don’t cause software to exist.

I found a solution here

1 Like