使用kcadm.sh将协议映射器添加到密钥斗篷 [英] Add protocol-mapper to keycloak using kcadm.sh
本文介绍了使用kcadm.sh将协议映射器添加到密钥斗篷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在尝试使用kcadmin cli在keycloak中设置完整的测试系统,但是在创建协议映射器时遇到一些问题:
I have been trying to setup my full test system in keycloak using the kcadmin cli, but I have some problems creating protocol mappers:
HTTP错误-400错误的请求
我一直在尝试使用以下方法来实现请求:
I have been trying to implement a request using:
http://www.keycloak.org/docs -api/3.3/rest-api/index.html http://blog.keycloak.org/2017/01/administer-keycloak-server-from-shell.html
我在请求中缺少什么吗?
Am I missing something in the request:
/opt/jboss/keycloak/bin/kcadm.sh create \
clients/7e8ef93b-0d0f-487d-84a5-5cfaee7ddf13/protocol-mappers/models \
-r $test_realm \
-s config.user.attribute=tenants \
-s config.claim.name=tenants \
-s config.jsonType.label=String \
-s config.id.token.claim=true \
-s config.access.token.claim=true \
-s config.userinfo.token.claim=true \
-s config.multivalued=true \
-s name=tenants \
-s protocolMapper=oidc-usermodel-attribute-mapper
这有效:
/opt/jboss/keycloak/bin/kcadm.sh create \
clients/7e8ef93b-0d0f-487d-84a5-5cfaee7ddf13/protocol-mappers/models \
-r $test_realm \
-s name=tenants1 \
-s protocol=openid-connect \
-s protocolMapper=oidc-usermodel-attribute-mapper
推荐答案
在失败的示例中,缺少以下值:
-s protocol=openid-connect
In the failing example the following value is missing:
-s protocol=openid-connect
这篇关于使用kcadm.sh将协议映射器添加到密钥斗篷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文