Skip to content

Commit c94a2d7

Browse files
committed
Update Keycloak Realm template
Recent Keycloak versions don't support custom mappers in individual clients anymore. To work around this issue, we instead patch the default `roles` client scope to include the `local-dev` client roles in the `groups` field of the ID and access tokens.
1 parent eb4364d commit c94a2d7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

local-env/templates/realm.json.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,21 @@
10131013
"consentRequired": false,
10141014
"config": {}
10151015
},
1016+
{
1017+
"name": "client-role-groups",
1018+
"protocol": "openid-connect",
1019+
"protocolMapper": "oidc-usermodel-client-role-mapper",
1020+
"consentRequired": false,
1021+
"config": {
1022+
"multivalued": "true",
1023+
"userinfo.token.claim": "false",
1024+
"id.token.claim": "true",
1025+
"access.token.claim": "true",
1026+
"claim.name": "groups",
1027+
"jsonType.label": "String",
1028+
"usermodel.clientRoleMapping.clientId": "local-dev"
1029+
}
1030+
},
10161031
{
10171032
"name": "client roles",
10181033
"protocol": "openid-connect",

0 commit comments

Comments
 (0)