小编kod*_*art的帖子

LightApp上的LightOpenID validate()失败

我正在使用LightOpenID对Google Apps进行OpenID身份验证.我做了初始的authURL()请求,事情很好.我调用validate()并且失败了.通过丰富的回声,我已将其追溯到最后几行validate().

从validate(),传递给discover($ url)的url是 https://www.google.com/accounts/o8/user-xrds?uri=http://my-domain.com/openid?id=117665028262121597341

discover()首先检查xrds-location,这是不存在的.discover()接下来检查内容类型是否为xrds + xml,这是真的.discover()检查Service(.*)/ Service,这是真的.这是服务,/服务的片段

<Service priority="0">
<Type>http://specs.openid.net/auth/2.0/signon</Type> 

<Type>http://openid.net/srv/ax/1.0</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>
<Type>http://specs.openid.net/extensions/pape/1.0</Type>
<URI>https://www.google.com/a/<my domain>.com/o8/ud?be=o8</URI>
</Service>
Run Code Online (Sandbox Code Playgroud)

discover()看到我们正在使用OpenID 2并将URI字段提取到$ server变量中.discover()继续提取CanonicalID,发现Google支持AX而不是SREG.最后,discover()返回$ server ashttps://www.google.com/a/my-domain.com/o8/ud?be=o8

validate()继续清理data []中的每个字段,具体取决于magic_quotes.它将openid.mode设置为'check_authentication',请求发现($ url)返回的$ server和'/ is_valid:true'的preg.这是最后一个preg_match失败了.$ server url不返回验证,而是说"您请求的页面无效".

我正在寻找的答案是Google Apps验证的正确网址.紧随其后的是网址应该是什么样子,我将深入了解Google Apps返回的信息,看看我是否有类似的东西.

增加:不确定这是否重要,但我确实有/.well-known/host-meta文件.以下是内容: Link: <https://www.google.com/accounts/o8/site-xrds?hd=my-domain.com>; rel="describedby http://reltype.google.com/openid/xrd-op"; type="application/xrds+xml"

如果您需要更多代码或数据,请告诉我们.

谢谢,Eric B.

php openid google-apps lightopenid

12
推荐指数
1
解决办法
1034
查看次数

标签 统计

google-apps ×1

lightopenid ×1

openid ×1

php ×1