linkKuzzleUser #
Links an existing Kuzzle user to a Keycloak user. This is useful when you want to associate a Keycloak identity to an already existing Kuzzle user.
Parameters #
| Parameter | Type | Description | Required |
|---|---|---|---|
| kuid | string | Kuzzle user ID | yes |
| kcuid | string | Keycloak user ID | yes |
Websocket #
await kuzzle.query({
controller: 'keycloak',
action: 'linkKuzzleUser',
body: {
kuid: '<kuid>',
kcuid: '<kcuid>'
}
});HTTP #
POST http://<host>:<port>/keycloak/linkKuzzleUser
Content-Type: application/json
{
"kuid": "<kuid>",
"kcuid": "<kcuid>"
}In witch case to use linkKuzzleUser? #
When a user is created in Keycloak, a corresponding Kuzzle user is automatically created when the user logs in for the first time.
However, if you have existing users in Kuzzle that you want to associate with Keycloak identities, you can use the linkKuzzleUser method. This allows you to link an existing Kuzzle user to a Keycloak user without creating a new Kuzzle user.
This is particularly useful in scenarios where you are migrating users to Keycloak
If you are in a case where you have no keycloak users yet and you have existing Kuzzle users, you can follow these steps:
- Create users in Keycloak that correspond to your existing Kuzzle users.
- Use the
linkKuzzleUsermethod to link each existing Kuzzle user to the corresponding Keycloak user.