function openid_discovery

openid_discovery($claimed_id)

Perform discovery on a claimed ID to determine the OpenID provider endpoint.

Discovery methods are provided by the hook_openid_discovery_method_info and could be further altered using the hook_openid_discovery_method_info_alter.

Parameters

$claimed_id: The OpenID URL to perform discovery on.

Return value

The resulting discovery array from the first successful discovery method, which must contain following keys:

  • 'services' (required) an array of discovered services (including OpenID

version, endpoint URI, etc).

  • 'claimed_id' (optional) new claimed identifer, found by following HTTP

redirects during the services discovery. If all the discovery method fails or if no appropriate discovery method is found, FALSE is returned.

File

modules/openid/openid.module, line 419
Implement OpenID Relying Party support for Drupal

Code

function openid_discovery($claimed_id) {
  module_load_include('inc', 'openid');

  $methods = module_invoke_all('openid_discovery_method_info');
  drupal_alter('openid_discovery_method_info', $methods);

  // Execute each method in turn and return first successful discovery.
  foreach ($methods as $method) {
    $discovery = $method($claimed_id);
    if (!empty($discovery)) {
      return $discovery;
    }
  }

  return FALSE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!openid!openid.module/function/openid_discovery/7.x