Select Git revision
-
Reiter, Christoph authored
This adds UserRolesInterface which is used for converting the oauth2 scopes to symfony roles. The default interface implementation converts them to "ROLE_SCOPE_FOO". The interface also gets passed the user ID and can fetch roles from other places as well, like LDAP, or ignore the scopes etc. Fixes #4
Reiter, Christoph authoredThis adds UserRolesInterface which is used for converting the oauth2 scopes to symfony roles. The default interface implementation converts them to "ROLE_SCOPE_FOO". The interface also gets passed the user ID and can fetch roles from other places as well, like LDAP, or ignore the scopes etc. Fixes #4
UserRolesInterface.php 258 B
<?php
declare(strict_types=1);
namespace Dbp\Relay\AuthBundle\API;
interface UserRolesInterface
{
/**
* @param string[] $scopes
*
* @return string[]
*/
public function getRoles(?string $userIdentifier, array $scopes): array;
}