07-21-2009, 09:05 AM
|
#1 (permalink)
|
|
The Visitor
Join Date: Jul 2009
Posts: 1
Thanks: 0
|
OpenID Keeps returning 'false' value.
Hey there,
I'm working on a project which includes an OpenID login page.
My code is very simple, but I keep getting 'is_valid:false' on the response, eventhough all variables was sent to the provider.
PHP Code:
ob_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $_GET['openid_identity'] );
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
$idhtml = ob_get_clean();
preg_match( "<link rel=\"openid.server\" href=\"(.*?)\" />", $idhtml, $found );
$url = $found[1];
$url .= "?openid.mode=check_authentication";
$url .= "&openid.assoc_handle=".urlencode( $_GET['openid_assoc_handle'] );
$url .= "&openid.sig=".urlencode( $_GET['openid_sig'] );
$url .= "&openid.signed=".urlencode( $_GET['openid_signed'] );
$url .= "&openid.response_nonce=".urlencode( $_GET['openid_response_nonce'] );
$url .= "&openid.identity=".urlencode( $_GET['openid_identity'] );
$url .= "&openid.op_endpoint=".urlencode( $_GET['openid_op_endpoint'] );
$url .= "&openid.return_to=".urlencode( $_GET['openid_return_to'] );
ob_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_exec($ch);
curl_close($ch);
$ca_resp = ob_get_clean();
print $ca_resp; // return 'is_valid:false'
Thanks in advanced, Tal Gleichger.
|
|
|
|