rmf
rmf

Reputation: 45

Get client secret in Keycloak 13/14?

In Keycloak 12, this call returned the client secret inside the 'credentials' object:

keycloak.realm(tenantId)
        .clients()
        .get(applicationId)
        .getInstallationProvider("keycloak-oidc-keycloak-json");

As of Keycloak 13, the same call no longer includes the 'secret' property in the 'credentials object:

https://issues.redhat.com/browse/KEYCLOAK-18257

Is there an alternative API call that will return the secret?

Upvotes: 0

Views: 324

Answers (1)

Jan Garaj
Jan Garaj

Reputation: 28676

You can use Get the client secret request from Keycloak Admin API (of course with correct permissions properly configured):

GET /{realm}/clients/{id}/client-secret

https://www.keycloak.org/docs-api/14.0/rest-api/index.html

I guess you can define secret directly in the registration payload, so you won't to retrieve secret after.

Upvotes: 1

Related Questions