您好
我几个小时前已经下载了LightOpenID(http://gitorious.org/lightopenid),但仍然无法弄清楚如何使它工作.
我把这个google示例保存在test.php文件中
<?php
require '../lib/init.php';
require '../lib/openID/openid.php';
try {
if(!isset($_GET['openid_mode'])) {
if(isset($_GET['login'])) {
$openid = new LightOpenID;
$openid->identity = 'https://www.google.com/accounts/o8/id';
header('Location: ' . $openid->authUrl());
}
?>
<form action="?login" method="post">
<button>Login with Google</button>
</form>
<?php
} elseif($_GET['openid_mode'] == 'cancel') {
echo 'User has canceled authentication!';
} else {
$openid = new LightOpenID;
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
} …Run Code Online (Sandbox Code Playgroud) 我遇到一个名为LightOpenID的小型OpenID库问题 .我可以对几乎所有提供商进行身份验证,但我不知道如何从提供程序获取数据.我只用print_r()得到了Array(),eaven.