From 312229751bab0a58bc2e164e1116922c864bfd59 Mon Sep 17 00:00:00 2001 From: iglocska Date: Thu, 25 Nov 2021 11:55:51 +0100 Subject: [PATCH] fix: [keycloak] enrollment org_id issues fixed --- src/Model/Behavior/AuthKeycloakBehavior.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Behavior/AuthKeycloakBehavior.php b/src/Model/Behavior/AuthKeycloakBehavior.php index 4b46a87..12bb3e2 100644 --- a/src/Model/Behavior/AuthKeycloakBehavior.php +++ b/src/Model/Behavior/AuthKeycloakBehavior.php @@ -108,7 +108,7 @@ class AuthKeycloakBehavior extends Behavior $role = $this->_table->Roles->find()->where($roleConditions)->first(); $org = $this->_table->Organisations->find()->where([ ['id' => $data['organisation_id']] - ]); + ])->first(); $token = $this->getAdminAccessToken(); $keyCloakUser = [ 'firstName' => $individual['first_name'], @@ -117,7 +117,7 @@ class AuthKeycloakBehavior extends Behavior 'email' => $individual['email'], 'attributes' => [ 'role_name' => empty($role['name']) ? Configure::read('keycloak.default_role_name') : $role['name'], - 'org_uuid' => $orgs['uuid'] + 'org_uuid' => $org['uuid'] ] ]; $keycloakConfig = Configure::read('keycloak');