有人可以帮我完成这项工作吗?
问题是它只是将查询字符串附加到 url 上,仅此而已。没有谷歌登录页面!
http://domain.nl/controller/function?action=verify&openid_identifier=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid
也许这是特定的事情,例如我使用 mvc 设计和 htaccess 文件。
我现在还不清楚解决方案。
请指出我正确的方向
谢谢,理查德
在控制器中......这是表单指向的功能
public function openid(){
try {
$openid = new LightOpenID;
if(!$openid->mode) {
if(isset($_GET['action'])) {
$openid->identity = 'https://www.google.com/accounts/o8/id';
//$openid->identity = 'https://www.google.com/accounts/o8/site-xrds?hd=YourDomain.in'; //this can be changed as you know...
header('Location: ' . $openid->authUrl());
}
/*<form action="?login" method="post">
<button>Login with Google</button>
</form>*/
} elseif($openid->mode == 'cancel') {
echo 'Gebruiker heeft authenticatie geannuleerd!';
} else {
echo 'Gebruiker ' . ($openid->validate() ? $openid->identity . ' heeft ' : 'heeft niet ') . 'ingelogd.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
}