如何激活keycloak的REST API? [英] How to activate the REST API of keycloak?
问题描述
我已经安装了密钥克隆服务器4.3.4. 如何激活keycloak的REST API(添加用户,已启用用户,已禁用用户...)?
I have installed keycloack server 4.3.4. How to activate the REST API of keycloak (Add a user, enabled user, disabled a user ...) ?
致谢
推荐答案
First step to do that is create an admin account (which you would have been prompted to do as soon as you would have opened {keycloak-url}/auth ).
下一步取决于您要如何创建配置.通过管理控制台GUI或Rest API.
Next steps depend on how you want to create config. Through Admin console GUI or through Rest API.
- First , you will have to get a token from {keycloak-url}/auth/realms/master/protocol/openid-connect/token like this:
请注意,在下面的调用中,您要做的唯一更改就是您的密钥斗篷服务器地址以及管理员用户名和密码的值.
Note that only change you have to do in below call is your keycloak server address and value of admin username and password.
- 从上述调用中获得令牌后,就可以在其他Bearer token_value设置
Authorization
标头,调用="noreferrer"> Admin Rest API . (将token_value替换为上述步骤1中获得的值)
- Once you obtain a token from above call, you can use it on other Admin Rest API calls by setting
Authorization
header, withBearer token_value
. (replace token_value with one obtained in step 1 above)
(在下面的示例Rest调用中共享一个获取用户列表的示例- https://www.keycloak.org/docs-api/10.0/rest-api/index.html#_users_resource )
(Sharing an example below of sample rest call which gets list of users - https://www.keycloak.org/docs-api/10.0/rest-api/index.html#_users_resource )
这篇关于如何激活keycloak的REST API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!