You are here

function openid_connect_get_client in OpenID Connect / OAuth client 7

Returns a client instance.

Parameters

string $client_name: The name of the client to instantiate.

Return value

OpenIDConnectClientInterface Client instance.

6 calls to openid_connect_get_client()
openid_connect_admin_form in includes/openid_connect.admin.inc
Form builder: Main administrative form.
openid_connect_admin_form_submit in includes/openid_connect.admin.inc
Submit handler for openid_connect_admin_form.
openid_connect_admin_form_validate in includes/openid_connect.admin.inc
Validation handler for openid_connect_admin_form.
openid_connect_connect_form_submit in includes/openid_connect.forms.inc
Submit callback for the connect account form.
openid_connect_login_form_submit in includes/openid_connect.forms.inc
Form submit handler: Log in with an OpenID Connect login provider.

... See full list

File

./openid_connect.module, line 96
A pluggable client implementation for the OpenID Connect protocol.

Code

function openid_connect_get_client($client_name) {
  $clients =& drupal_static(__FUNCTION__);
  if (!isset($clients[$client_name])) {
    $plugin = openid_connect_get_plugin($client_name);
    if ($plugin) {
      $settings = variable_get('openid_connect_client_' . $client_name, array());
      $clients[$client_name] = new $plugin['class']($client_name, $plugin['title'], $settings);
    }
    else {
      $clients[$client_name] = FALSE;
    }
  }
  return $clients[$client_name];
}