Skip to content

Commit 7cb616c

Browse files
cbcoutinhoclaude
andcommitted
feat: Auto-configure impersonation role in Keycloak realm import
Add service account user with impersonation role to realm-export.json so that Tier 1 impersonation works out-of-the-box without requiring manual CLI configuration. Changes: - Add service-account-nextcloud-mcp-server user to realm import - Grant "impersonation" role from "realm-management" client - Eliminates need for manual `kcadm.sh add-roles` command Benefits: - Impersonation tests now pass automatically - No manual permission configuration required - Consistent development environment setup Verified: - Manual test: tests/manual/test_impersonation.py ✅ PASS - Integration tests: tests/integration/auth/test_token_exchange_legacy_v1.py ✅ 3 PASS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 34df5f5 commit 7cb616c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

keycloak/realm-export.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@
150150
"1073741824"
151151
]
152152
}
153+
},
154+
{
155+
"username": "service-account-nextcloud-mcp-server",
156+
"enabled": true,
157+
"serviceAccountClientId": "nextcloud-mcp-server",
158+
"clientRoles": {
159+
"realm-management": [
160+
"impersonation"
161+
]
162+
}
153163
}
154164
],
155165
"clients": [

0 commit comments

Comments
 (0)