Commit 9b735710 authored by Dries's avatar Dries

- Patch #222044 by c960657: better support for different OpenID versions.

parent 05c39fe7
......@@ -477,17 +477,16 @@ function openid_association_request($public) {
function openid_authentication_request($claimed_id, $identity, $return_to = '', $assoc_handle = '', $version = 2) {
module_load_include('inc', 'openid');
$ns = ($version == 2) ? OPENID_NS_2_0 : OPENID_NS_1_0;
$request = array(
'openid.ns' => $ns,
'openid.mode' => 'checkid_setup',
'openid.identity' => $identity,
'openid.claimed_id' => $claimed_id,
'openid.assoc_handle' => $assoc_handle,
'openid.return_to' => $return_to,
);
if ($version == 2) {
$request['openid.ns'] = OPENID_NS_2_0;
$request['openid.claimed_id'] = $claimed_id;
$request['openid.realm'] = url('', array('absolute' => TRUE));
}
else {
......
......@@ -206,10 +206,11 @@ function _openid_test_endpoint_authenticate() {
// entries contain profile data stored by the OpenID Provider (see OpenID
// Simple Registration Extension 1.0).
$response = array(
'openid.ns' => 'http://specs.openid.net/auth/2.0',
'openid.ns' => OPENID_NS_2_0,
'openid.mode' => 'id_res',
'openid.op_endpoint' => $base_url . url('openid/provider'),
'openid.claimed_id' => $_REQUEST['openid_claimed_id'],
// openid.claimed_id is not sent by OpenID 1 clients.
'openid.claimed_id' => isset($_REQUEST['openid_claimed_id']) ? $_REQUEST['openid_claimed_id'] : '',
'openid.identity' => $_REQUEST['openid_identity'],
'openid.return_to' => $_REQUEST['openid_return_to'],
'openid.response_nonce' => $nonce,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment