diff --git a/Security/Authentication/Token/SSOToken.php b/Security/Authentication/Token/SSOToken.php index 9086e8f..9bd20ae 100644 --- a/Security/Authentication/Token/SSOToken.php +++ b/Security/Authentication/Token/SSOToken.php @@ -135,9 +135,14 @@ public function getRoles() $allRoles = array_merge($parentRoles, $this->storedRoles); $uniqueRoles = []; - /** @var Role $role */ + /** @var Role|string $role */ foreach ($allRoles as $role) { - $uniqueRoles[$role->getRole()] = $role; + $stringRole = $role; + if ($role instanceof Role) { + $stringRole = $role->getRole(); + } + + $uniqueRoles[$stringRole] = $role; } return array_values($uniqueRoles);