使用 kcadm.sh 将协议映射器添加到 keycloak
Add protocol-mapper to keycloak using kcadm.sh
我一直在尝试使用 kcadmin cli 在 keycloak 中设置我的完整测试系统,但是我在创建协议映射器时遇到了一些问题:
HTTP 错误 - 400 错误请求
我一直在尝试使用以下方法实现请求:
http://www.keycloak.org/docs-api/3.3/rest-api/index.html
http://blog.keycloak.org/2017/01/administer-keycloak-server-from-shell.html
我是否遗漏了请求中的内容:
/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
您需要像这样在 Linux 中指定嵌套配置值:
-s 'config."id.token.claim"=true'
-s 'config."included.client.audience"=theclient'
我一直在尝试使用 kcadmin cli 在 keycloak 中设置我的完整测试系统,但是我在创建协议映射器时遇到了一些问题:
HTTP 错误 - 400 错误请求
我一直在尝试使用以下方法实现请求:
http://www.keycloak.org/docs-api/3.3/rest-api/index.html http://blog.keycloak.org/2017/01/administer-keycloak-server-from-shell.html
我是否遗漏了请求中的内容:
/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
您需要像这样在 Linux 中指定嵌套配置值:
-s 'config."id.token.claim"=true'
-s 'config."included.client.audience"=theclient'