From 69fee0249867f519e36082c45143834343411482 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 21 Sep 2022 10:06:33 +0200 Subject: [PATCH] fix: [authKeycloakBehavior] Re-indexing array preventing roles to be parsed by keycloak --- src/Model/Behavior/AuthKeycloakBehavior.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model/Behavior/AuthKeycloakBehavior.php b/src/Model/Behavior/AuthKeycloakBehavior.php index 7aeed31..4d5f509 100644 --- a/src/Model/Behavior/AuthKeycloakBehavior.php +++ b/src/Model/Behavior/AuthKeycloakBehavior.php @@ -472,6 +472,7 @@ class AuthKeycloakBehavior extends Behavior $toAdd[$k] = $userRoles[$name]; } if (!empty($toAdd)) { + $toAdd = array_values($toAdd); $response = $this->restApiRequest('%s/admin/realms/%s/users/' . $keycloakUser['id'] . '/role-mappings/clients/' . $clientId, $toAdd, 'post'); if (!$response->isOk()) { $this->_table->auditLogs()->insert([