Hello
I have downloaded LightOpenID (http://gitorious.org/lightopenid) few hours ago but still can\'t figure out how to make it work.
I got this google example saved
when a user clicked on 'Login with Google' button on 'example-google.php page you will be redirected to google and if user accept the request he will be redirected to your page again and you can get only the Openid of user.
But if you want to get some other info or change the OpenID provide you can to it on this way:
mode) {
if(isset($_GET['oidType'])) {
$oidType = $_GET['oidType'];
$openid = new LightOpenID;
if ($oidType==1)
{
$openid->identity = 'https://www.google.com/accounts/o8/id';
}
else
{
$openid->identity = 'https://me.yahoo.com ';
}
$openid->required = array(
'namePerson',
'namePerson/first',
'namePerson/last',
'contact/email',
);
$openid->returnUrl = 'http://www.yourdomain.com/login.php';
header('Location: ' . $openid->authUrl());
}
?>
Login with Google
Login with Yahoo
mode == 'cancel') {
echo 'User has canceled authentication!';
}
} elseif($openid->validate()) {
$openid_identity = $openid->identity;
$data = $openid->getAttributes();
$email = $data['contact/email'];
$namePerson = $data['namePerson'];
$first = $data['namePerson/first'];
$last = $data['namePerson/last'];
echo "Openid:$identitystr
";
echo "Email : $email
";
echo "namePerson : $namePerson
";
echo "first : $first
";
echo "last : $last
";
} else {
echo "The user has not logged in";
}
} catch(ErrorException $e) {
echo $e->getMessage();
}