如何通过keypolt API获取客户端机密?
在文档中我看到:
GET /admin/realms/{realm}/clients/{id}/client-secret
我的代码如下:
data = {
"grant_type" : 'password',
"client_id" : 'myclientid',
"username" : 'myusername',
"password" : 'mypassword'
}
response = requests.get("https://mylink.com/auth/admin/realms/{myrealm}/clients/{myclientid}/client-secret", data=data, headers= {"Content-Type": "application/json"})
我总是得到401错误。
我做错什么了?
我想你的身份验证没用。
示例:
拿到令牌
对API的请求
{id}在URL中不是clientId,它不同于clientId。 它是keycolpt惟一id(即
uuid
),类似于628e4b46-3d79-454f-9b1c-e07e86ee7615
您可以使用此api获取id,它返回ClientRepresentation列表,该列表同时具有id和clientId,使用id
`
相关问题 更多 >
编程相关推荐