钥匙斗篷客户端有客户端秘密吗?

密钥披露客户端 ID 是否有一个客户端机密?我试图在密钥斗篷管理中创建一个客户端,但是我无法发现客户端秘密。

它是自动生成的吗? 我从哪里可以得到这个秘密?

90374 次浏览

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

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

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

For me above mentioned step access-type tab not found. What did work for me is:

  1. Select your realm in my case "istiomesh"
  2. Select "clients" tab in left bar
  3. You may see two tabs "client list" and "Initial access token". Select later one and create Initial access token Create client secret

4. Copy that token and use as secret