OpenIDは実装/文書化が不十分であるため、私はOpenIDが嫌いであると言い始めます。
「openid-php-openid-2.2.2-24」を使おうとしています。ここにソースコードがあります:https ://github.com/openid/php-openid
認証の例を使用しようとすると、次のように返されます。「https://www.google.com/accounts/o8/id?id=[...]がIDとして正常に確認されました。
プロバイダーからPAPE応答は送信されませんでした。」
ただし、メール、ニックネーム、またはgoogleopenidログインデータのフルネームの影はありません。ファイル( "/openid/examples/consumer/finish_auth.php")を読んでいる間、「検証に成功しました」メッセージと「PAPE応答なし」メッセージの間にSREG変数を出力する必要があることに注意しますが、次のことは行いません。
$success = sprintf('You have successfully verified ' .
'<a href="%s">%s</a> as your identity.',
$esc_identity, $esc_identity);
if ($response->endpoint->canonicalID) {
$escaped_canonicalID = escape($response->endpoint->canonicalID);
$success .= ' (XRI CanonicalID: '.$escaped_canonicalID.') ';
}
$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);
$sreg = $sreg_resp->contents();
if (@$sreg['email']) {
$success .= " You also returned '".escape($sreg['email']).
"' as your email.";
}
if (@$sreg['nickname']) {
$success .= " Your nickname is '".escape($sreg['nickname']).
"'.";
$_SESSION['nickname'] = escape($sreg['nickname']);
}
if (@$sreg['fullname']) {
$success .= " Your fullname is '".escape($sreg['fullname']).
"'.";
}
$pape_resp = Auth_OpenID_PAPE_Response::fromSuccessResponse($response);
if ($pape_resp) {
[...]
} else {
$success .= "<p>No PAPE response was sent by the provider.</p>";
}
$ sreg ['email']、$ sreg ['nickname']、$ sreg ['fullname']のコンテンツを印刷しようとしましたが、すべて空白のコンテンツ(null /空の値)が返されます。
ユーザーがログインに使用するアカウントのメールアドレスを取得する必要があります。
ダンテ