You are here

function oauth2_server_site_needs_keys in OAuth2 Server 7

Returns whether the current site needs to have keys generated.

Return value

bool TRUE if at least one server uses JWT Access Tokens or OpenID Connect, FALSE otherwise.

1 call to oauth2_server_site_needs_keys()
oauth2_server_cron in ./oauth2_server.module
Implements hook_cron().
1 string reference to 'oauth2_server_site_needs_keys'
oauth2_server_menu in ./oauth2_server.module
Implements hook_menu().

File

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

Code

function oauth2_server_site_needs_keys() {
  $servers = entity_load('oauth2_server');
  foreach ($servers as $server) {
    if (!empty($server->settings['use_crypto_tokens'])) {
      return TRUE;
    }
    if (!empty($server->settings['use_openid_connect'])) {
      return TRUE;
    }
  }
  return FALSE;
}