Skip to content
Snippets Groups Projects
Select Git revision
  • b9b92a27726890161db8af49c586d1160762aeb8
  • main default
  • keycloak-deprecate
  • remove-jwt-easy
  • ci-update
  • v0.1.15
  • v0.1.14
  • v0.1.13
  • v0.1.12
  • v0.1.11
  • v0.1.10
  • v0.1.9
  • v0.1.8
  • v0.1.7
  • v0.1.6
  • v0.1.5
  • v0.1.4
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
21 results

UserRolesInterface.php

Blame
    • Reiter, Christoph's avatar
      89d4166c
      Add an interface that allows customizing the user roles · 89d4166c
      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
      89d4166c
      History
      Add an interface that allows customizing the user roles
      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
    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;
    }