【发布时间】:2011-04-30 01:06:12
【问题描述】:
我正在使用 LightOpenID 并且有一个测试页面,该页面几乎是随附的 example-google.php 的副本(我投入了一些 echo 进行调试)。单击“使用 Google 登录”按钮会将我带到 Google。我使用有效的 Google Apps 电子邮件地址登录,然后返回到我的页面。但是,当它尝试验证claim_id 时,我得到一个“未找到服务器!”信息。
我已经在谷歌上搜索了该短语以寻求指导,但大多数回复只是指向 gitorious checkins 的链接。我钻研代码,使用 fwrites 显示代码按以下顺序执行...
(由于我放入了所有调试代码,我的行号可能有点偏差......)
openid.php:validate() 被调用。在 validate() 中,大约 568 行是这一行...
$server = $this->discover($this->data['openid_identity']);
在这一行之后,$server 为空,即''。
我可以证明在discover($url)的开头,变量
$url = http://<my Google Apps domain>.com/openid?id=117665028262121597341
问题在于调用 htmlTag() 时,$server 没有在第 364 行 (openid.php) 设置。为 $content 抓取相同的 $url 但该 URL 返回 404,然后 htmlTag() 中的 pregs 失败
$url 不正确吗?它是直接从“openid_identity”设置的,我认为它来自 Google Apps。
这是成功登录 Google Apps 后返回的 URL。
http://intranet.<my domain>.com/<my path>/validate.php?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Fa%2F<my Google App domain>%2Fo8%2Fud%3Fbe%3Do8&openid.response_nonce=2010-10-25T04%3A23%3A26ZFQ4Fq3F3W1b9ug&openid.return_to=http%3A%2F%2Fintranet.<my domain>.com%2F<my path>%2Fvalidate.php&openid.assoc_handle=AOQobUeErcWBdJC6slZm3nCw_BRbvHTjpdtycleA2P89n15QCCr8fRDE&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle&openid.sig=yrja2H%2Fvufp2BqezN4NIVGA5wWM%3D&openid.identity=http%3A%2F%2F<my Google App domain>%2Fopenid%3Fid%3D117665028262121597341&openid.claimed_id=http%3A%2F%2F<my Google App domain>%2Fopenid%3Fid%3D117665028262121597341
我是 OpenID 的新手,因此非常感谢您在此处指出正确方向的短语或链接。
谢谢, 埃里克 B.
【问题讨论】:
-
虽然我对 Google Apps 了解不多,但身份 url 必须是可发现的,即包含有关 openid 服务器的信息。所以如果它确实返回 404,LightOpenID 无法发现服务器,因此无法执行验证。
标签: openid validation google-apps lightopenid