Skip to content

Commit

Permalink
Fix group evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
buchmarv committed Aug 26, 2024
1 parent 6fef605 commit e5c6029
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Security/KeyCloakUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class KeyCloakUserProvider implements UserProviderInterface
{
private array $roleMapping;
private array $defaultRoles;
private array $userRoles = [];

public function __construct(array $roleMapping, array $defaultRoles = ['ROLE_USER', 'ROLE_OAUTH_USER'])
{
Expand All @@ -45,7 +44,7 @@ public function loadUserByIdentifier(
): KeyCloakUser {
$roles = array_intersect_key($this->roleMapping, array_flip(array_map(static function ($v) {
return str_replace('-', '_', $v);
}, $this->userRoles)));
}, $keycloakGroups)));
$roles = array_merge($roles, $scopes, $this->defaultRoles);

return new KeyCloakUser($identifier, array_values($roles), $email, $fullName, $fresh);
Expand Down

0 comments on commit e5c6029

Please sign in to comment.