function openid_authentication_request

1 call to openid_authentication_request()
openid_begin in drupal/core/modules/openid/openid.module
The initial step of OpenID authentication responsible for the following:

File

drupal/core/modules/openid/openid.module, line 806
Implement OpenID Relying Party support for Drupal

Code

function openid_authentication_request($claimed_id, $identity, $return_to = '', $assoc_handle = '', $service) {
  global $base_url;
  module_load_include('inc', 'openid');
  $request = array(
    'openid.mode' => 'checkid_setup',
    'openid.identity' => $identity,
    'openid.assoc_handle' => $assoc_handle,
    'openid.return_to' => $return_to,
  );
  if ($service['version'] == 2) {
    $request['openid.ns'] = OPENID_NS_2_0;
    $request['openid.claimed_id'] = $claimed_id;
    $request['openid.realm'] = $base_url . '/';
  }
  else {
    $request['openid.trust_root'] = $base_url . '/';
  }

  // Always request Simple Registration. The specification doesn't mandate
  // that the Endpoint advertise OPENID_NS_SREG in the service description.
  $request['openid.ns.sreg'] = OPENID_NS_SREG;
  $request['openid.sreg.required'] = 'nickname,email';
  $request['openid.sreg.optional'] = 'timezone,language';

  // Request Attribute Exchange, if available.
  // We only request the minimum attributes we need here, contributed modules
  // can alter the request to add more attribute, and map them to profile fields.
  if (in_array(OPENID_NS_AX, $service['types'])) {
    $request['openid.ns.ax'] = OPENID_NS_AX;
    $request['openid.ax.mode'] = 'fetch_request';
    $request['openid.ax.required'] = 'mail_ao,name_ao,mail_son,name_son';
    $request['openid.ax.if_available'] = 'timezone_ao,language_ao,timezone_son,language_son';

    // Implementors disagree on which URIs to use, even for simple
    // attributes like name and email (*sigh*). We ask for both axschema.org
    // attributes (which are supposed to be newer), and schema.openid.net ones
    // (which are supposed to be legacy).
    // Attributes as defined by axschema.org.
    $request['openid.ax.type.mail_ao'] = 'http://axschema.org/contact/email';
    $request['openid.ax.type.name_ao'] = 'http://axschema.org/namePerson/friendly';
    $request['openid.ax.type.timezone_ao'] = 'http://axschema.org/pref/timezone';
    $request['openid.ax.type.language_ao'] = 'http://axschema.org/pref/language';

    // Attributes as defined by schema.openid.net.
    $request['openid.ax.type.mail_son'] = 'http://schema.openid.net/contact/email';
    $request['openid.ax.type.name_son'] = 'http://schema.openid.net/namePerson/friendly';
    $request['openid.ax.type.timezone_son'] = 'http://openid.net/schema/timezone';
    $request['openid.ax.type.language_son'] = 'http://openid.net/schema/language/pref';
  }
  drupal_alter('openid_request', $request, $service);
  return $request;
}