You are here

protected function Oauth2GrantManager::checkKeyPaths in Simple OAuth (OAuth2) & OpenID Connect 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/Oauth2GrantManager.php \Drupal\simple_oauth\Plugin\Oauth2GrantManager::checkKeyPaths()
  2. 8.3 src/Plugin/Oauth2GrantManager.php \Drupal\simple_oauth\Plugin\Oauth2GrantManager::checkKeyPaths()
  3. 5.x src/Plugin/Oauth2GrantManager.php \Drupal\simple_oauth\Plugin\Oauth2GrantManager::checkKeyPaths()

Throws

\League\OAuth2\Server\Exception\OAuthServerException If one or both keys are not set properly.

1 call to Oauth2GrantManager::checkKeyPaths()
Oauth2GrantManager::getAuthorizationServer in src/Plugin/Oauth2GrantManager.php
Gets the authorization server.

File

src/Plugin/Oauth2GrantManager.php, line 184

Class

Oauth2GrantManager
Provides the OAuth2 Grant plugin manager.

Namespace

Drupal\simple_oauth\Plugin

Code

protected function checkKeyPaths() {
  if (!file_exists($this->publicKeyPath) || !file_exists($this->privateKeyPath)) {
    throw OAuthServerException::serverError(sprintf('You need to set the OAuth2 secret and private keys.'));
  }
}