You are here

public function ResourceServer::__construct in Simple OAuth (OAuth2) & OpenID Connect 8.2

Same name and namespace in other branches
  1. 8.4 src/Server/ResourceServer.php \Drupal\simple_oauth\Server\ResourceServer::__construct()
  2. 8.3 src/Server/ResourceServer.php \Drupal\simple_oauth\Server\ResourceServer::__construct()
  3. 5.x src/Server/ResourceServer.php \Drupal\simple_oauth\Server\ResourceServer::__construct()

ResourceServer constructor.

File

src/Server/ResourceServer.php, line 33

Class

ResourceServer

Namespace

Drupal\simple_oauth\Server

Code

public function __construct(AccessTokenRepositoryInterface $access_token_repository, ConfigFactoryInterface $config_factory, HttpMessageFactoryInterface $message_factory, HttpFoundationFactoryInterface $foundation_factory) {
  try {
    if ($public_key = $config_factory
      ->get('simple_oauth.settings')
      ->get('public_key')) {
      $this->subject = new LeageResourceServer($access_token_repository, realpath($public_key));
    }
  } catch (\LogicException $exception) {
  }
  $this->messageFactory = $message_factory;
  $this->foundationFactory = $foundation_factory;
}