Keycloak v.18:如何使用 Keycloak API 与用户进行操作

2024-01-04

我试图获取并更改某些特定用户(姓名、电子邮件等),但我的链接返回一些未知错误。这是我的链接:http://localhost:8080/admin/realms/space-realm/users。你能解释一下我做错了什么吗?将不胜感激。


This step is overview. enter image description here

1 Find master access token URL enter image description here enter image description here

在我的演示网址中,

http://localhost:8180/auth/realms/master/protocol/openid-connect/token

This may help long life of access-token time if you needs to more space time to handle step 3 and 4 enter image description here

2 Get master token run postman, use #1-4 URL assign variable in tests tab enter image description here

访问令牌变量将使用 #3 和 #4

var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("access-token", jsonData.access_token);

set the Key in Body tab with x-www-form-urlencoded option Click Send button enter image description here

Should be return OK 200 status and see the access token enter image description here

3 Get space-realm user I added one user, I will get this user information enter image description here In my get user list URL

http://localhost:8180/auth/admin/realms/space-realm/users

在“授权”选项卡中使用此变量

{{access-token}}

4 Update user properties with 3's user UI set header enter image description here

The status should be 204 No Content status enter image description here

if get user information by id, get this result with changed properties. enter image description here

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Keycloak v.18:如何使用 Keycloak API 与用户进行操作 的相关文章

随机推荐