English 中文(简体)
Add custom attribute in my keycloak client roles
原标题:
  • 时间:2023-07-11 15:19:28
  •  标签:
  • keycloak

I can add a custom attribute to my user following this link. I want to add a (common) custom attribute to my client roles. Is it possible? I tried to replicate the custom attribute like my user without success. Could you help me?

问题回答

You can use this API

Set the custom attributes of client s role

PUT [Keycloak URL](/auth)/admin/realms/[realm name]/roles-by-id/[role UUID]

Body

{
    "name": [Role Name],
    "composite": false,
    "clientRole": true,
    "containerId": [client UUID],
    "attributes": {
        "key 1": [
            "value 1"
        ],
        "key 2": [
            "value 2"
        ]
    }
}

enter image description here

Get the custom attributes of client s role

GET [Keycloak URL](/auth)/admin/realms/[realm name]/client/[client UUID]/[role name]

enter image description here

Keycloak UI

enter image description here

Finally, you can get user s mapping client role

GET [KEYCLOAK URL](/auth)/admin/realms/[realm name]/users/[user UUID]/role-mappings/clients/[Client UUID]

enter image description here

How to get Client s Role ID

GET [Keycloak URL](/auth)/admin/realms/[realm name]/clients/[client UUID]/roles

enter image description here





相关问题
凌驾于多租期的钥匙花 the?

so I have micro service application where one of those called auth_manager used to authenticate and register new user , I use the auth_manager to get token for user from keycloak , and other services ...

Add custom attribute in my keycloak client roles

I can add a custom attribute to my user following this link. I want to add a (common) custom attribute to my client roles. Is it possible? I tried to replicate the custom attribute like my user ...

Keycloak custom theme reject login.ftl

I create custom keycloak login screen. I download from keycloak web page Server Standalone server distribution And copy from keycloak-8.0.2 hemeskeycloak to C:xxconfigurationkeycloak...

WSO2 APIM 4.2 http gateaway mixed content error

I m using wso2 apim 4.2 with keycloak key manager to invoke an api through http. I published the api to get published through http and https, for the domain I already inject the ssl on wso2 apim. I ...

热门标签