2

When calling the keycloak REST api (see below) the output value is a string of asterisks (stars) - is it possible to get this information in clear text?

  curl \
  --silent \
  --request GET \
  -H "Authorization: bearer <MYACCESSTOKEN>" \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  "http://keycloakserver:8180/auth/admin/realms/myrealm/clients/<MYCLIENTID>/client-secret" 

returns/output:

{"type":"secret","value":"**********"}

How can it be retrieved in a text (not stars) format?

The client is configured with:

  • clientt protocol: openid-connect
  • access type: confidential
  • standard flow: enabled
dreamcrash
  • 47,137
  • 25
  • 94
  • 117

1 Answers1

4

First, you need to generate the secret. Either via Admin Console:

enter image description here

Or via keycloak REST api, in your case (using POST instead of GET):

 curl \
  --silent \
  --request POST \
  -H "Authorization: bearer <MYACCESSTOKEN>" \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  "http://keycloakserver:8180/auth/admin/realms/myrealm/clients/<MYCLIENTID>/client-secret" 
dreamcrash
  • 47,137
  • 25
  • 94
  • 117