我一直在尝试使用 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
Run Code Online (Sandbox Code Playgroud)
这有效:
/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
Run Code Online (Sandbox Code Playgroud)
您需要在 Linux 中指定这样的嵌套配置值:
-s 'config."id.token.claim"=true'
-s 'config."included.client.audience"=theclient'
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2043 次 |
最近记录: |