ScopeEntity.php in Simple OAuth (OAuth2) & OpenID Connect 8.2
File
src/Entities/ScopeEntity.php
View source
<?php
namespace Drupal\simple_oauth\Entities;
use Drupal\user\RoleInterface;
use League\OAuth2\Server\Entities\ScopeEntityInterface;
use League\OAuth2\Server\Entities\Traits\EntityTrait;
class ScopeEntity implements ScopeEntityInterface {
use EntityTrait;
public function __construct(RoleInterface $role) {
$this->role = $role;
$this
->setIdentifier($role
->id());
}
public function jsonSerialize() {
return $this
->getIdentifier();
}
}