You are here

function oauth2_server_hash_client_secret in OAuth2 Server 7

Hash a client secret for storage.

Parameters

string $client_secret: The raw secret.

Return value

string The hashed secret.

4 calls to oauth2_server_hash_client_secret()
OAuth2ServerStorageTestCase::setUp in tests/oauth2_server.test
Sets up a Drupal site for running functional and integration tests.
OAuth2ServerTestCase::setUp in tests/oauth2_server.test
Sets up a Drupal site for running functional and integration tests.
oauth2_server_client_form_validate in includes/oauth2_server.client_admin.inc
Validation callback.
oauth2_server_update_7106 in ./oauth2_server.install
Hash all client secrets.

File

./oauth2_server.module, line 604
Provides OAuth2 server functionality.

Code

function oauth2_server_hash_client_secret($client_secret) {
  if ($client_secret === '') {
    return $client_secret;
  }
  require_once DRUPAL_ROOT . '/includes/password.inc';
  return user_hash_password($client_secret);
}