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.
$claimed_id: The OpenID URL to perform discovery on.
The resulting discovery array from the first successful discovery method, which must contain following keys:
version, endpoint URI, etc).
redirects during the services discovery. If all the discovery method fails or if no appropriate discovery method is found, FALSE is returned.
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;
}