Do Keycloak Clients have a Client Secret?

Keycloak

Keycloak Problem Overview


Does keycloak client id has a client secret? I tried to create a client in keycloak admin but I was not able to spot client secret.

Is it auto generated? Where can I get the secret?

Keycloak Solutions


Solution 1 - Keycloak

Your client need to have the access-type set to confidential , then you will have a new tab credentials where you will see the client secret.
https://wjw465150.gitbooks.io/keycloak-documentation/content/server_admin/topics/clients/oidc/confidential.html

Solution 2 - Keycloak

Client need to have the access-type set to confidential and you can see the client Secret in credentials tab

Solution 3 - Keycloak

> Does keycloak client id has a client secret? I tried to create a > client in keycloak admin but I was not able to spot client secret.

First, you should know that Keycloak implements OpenID Connect, which

> is a simple identity layer on top of the OAuth 2.0 protocol.

According to the OAuth 2.0 protocol clients can be either confidential or public.

> The main difference relates to whether or not the application is able > to hold credentials (such as a client ID and secret) securely.

Regarding the confidential clients:

> Because they use a trusted backend server, confidential applications > can use grant types that require them to authenticate by specifying > their client ID and client secret when calling the Token endpoint.

Armed with this knowledge you can easily create a client that will have a client secret as follows:

  1. Create a client with "Access Type" set to confidential: enter image description here
  2. Click the Save button;
  3. Afterwards a new tab named "Credentials" will show up : enter image description here
  4. And there you can see the client secret: enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Question王子1986View Question on Stackoverflow
Solution 1 - KeycloakSébastien BlancView Answer on Stackoverflow
Solution 2 - KeycloakravthiruView Answer on Stackoverflow
Solution 3 - KeycloakdreamcrashView Answer on Stackoverflow