You are here

public function OAuth2Storage::getClientKey in OAuth2 Server 8

Same name and namespace in other branches
  1. 2.0.x src/OAuth2Storage.php \Drupal\oauth2_server\OAuth2Storage::getClientKey()

Get client key.

Parameters

string $client_id: The client id string.

string $subject: The subject string.

Return value

string|bool The client id public key or false.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/OAuth2Storage.php, line 585

Class

OAuth2Storage
Provides Drupal OAuth2 storage for the library.

Namespace

Drupal\oauth2_server

Code

public function getClientKey($client_id, $subject) {

  // While the API supports a key per user (subject), the module only supports
  // one key per client, since it's the simpler and more frequent use case.
  $client = $this
    ->getClientDetails($client_id);
  return $client ? $client['public_key'] : FALSE;
}