2010-03-16 96 views
0

总是:https://www.google.com/accounts/o8/ud为什么我的Google终端始终如此?

我得到了wordpress openid ok。所以我觉得仅仅是发现阶段有一些probelms ..

<?php $ch = curl_init(); 



$url = 'https://www.google.com/accounts/o8/id'; 
$url = $url.'?'; 
$url = $url.'openid.mode=checkid_setup'; 
$url = $url.'&openid.ns=http://specs.openid.net/auth/2.0'; 
$url = $url.'&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select'; 
$url = $url.'&openid.identity=http://specs.openid.net/auth/2.0/identifier_select'; 
$url = $url.'&openid.return_to='.site_url().'/user/openid/login_callback'; 
$url = $url.'&openid.realm=http://www.example.com/'; 


// set url 
curl_setopt($ch, CURLOPT_URL, $url); 

//return the transfer as a string 
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HTTPHEADER,array("Accept: */*")); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 

// $output contains the output string 
$xdr = curl_exec($ch); 
if (!$xdr) { 
    die(curl_error($ch)); 
} 
// close curl resource to free up system resources 
curl_close($ch); 
$xml = new SimpleXMLElement($xdr); 

$url = $xml->XRD->Service->URI; 
$request = $connection->begin($url); 

$请求总是空...

回答

0

您的问题有正确的端点URL(以/ud结尾的端点URL),但示例代码正在将请求发送到标识符URL(/id),而不是端点URL。