我在我的网站上使用PHP实现OpenID。 我写的代码如下......
<?php
session_start();
require_once('openid.php');
try
{
# Change 'localhost' to your domain name.
$openid = new LightOpenID('openid.ch.net16.com');
$openid->required = array(
'namePerson',
'namePerson/first',
'namePerson/last',
'contact/email',
);
$openid->identity = 'https://www.google.com/accounts/o8/id';
$openid->returnUrl = 'http://www.openid.ch.net16.com/home.php';
if(!$openid->mode)
{
$_SESSION['auth']="Google";
header('Location: ' . $openid->authUrl());
}
else
{
echo 'User has canceled authentication!';
}
}
catch(ErrorException $e)
{
echo $e->getMessage();
}
?>
但谷歌说如下......
错误:invalid_request
解析OpenID身份验证请求时出错 了解更多
请帮我解决这个问题............