<?php
require 'openid.php';
try
{
# Change 'localhost' to your domain name.
$openid = new LightOpenID('localhost');
if(!$openid->mode)
{
if(isset($_GET['login']))
{
$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($openid->mode == 'cancel')
{
echo 'User has canceled authentication!';
}
else
{
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
}
catch(ErrorException $e)
{
echo $e->getMessage();
}
この質問は尋ねられましたが、テストが不足しているため、大部分は答えられませんでした。問題は、ログイン後に Google ボタンでログインが表示されないのはなぜですか?
注:これはopenidであり、表示後にGoogleにリダイレクトされ、Googleにログインした後にページに戻りますが、ログイン後にボタンが表示されません。理由は?