Nav*_*eon 2 openid oauth aol xrds
我试图使用AOL openid,坚持得到"AOL无法验证这个网站"
谁能告诉我避免这个错误的步骤,我该怎么做才能避免这个错误.
如果有一些示例代码请分享 - 提前感谢
问候,
纳文
乔治谢谢你的回答,但我有问题让它工作,我的xrds文件如下
<?php
header('Content-type: application/xrds+xml');
$xrdstext = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$xrdstext =$xrdstext . "<xrds:XRDS";
$xrdstext =$xrdstext ." xmlns:xrds=\"xri://$xrds\"";
$xrdstext =$xrdstext ." xmlns:openid=\"http://openid.net/xmlns/1.0\"";
$xrdstext =$xrdstext ." xmlns=\"xri://$xrd*($v*2.0)\">\n";
$xrdstext =$xrdstext ."<XRD>\n";
$xrdstext =$xrdstext ."<Service xmlns=\"xri://$xrd*($v*2.0)\">\n";
$xrdstext =$xrdstext ."<Type>http://specs.openid.net/auth/2.0/return_to</Type>\n";
$xrdstext =$xrdstext ."<URI>http://localhost:56709/myproject/socialoauth.aspx</URI>\n";
$xrdstext =$xrdstext ."</Service>\n";
$xrdstext =$xrdstext ."</XRD>\n";
$xrdstext =$xrdstext ."</xrds:XRDS>";
echo $xrdstext;
?>
Run Code Online (Sandbox Code Playgroud)
我的请求网址是
我不确定我做错了什么
请帮忙......
因此,此错误的原因是AOL无法验证Rely Party return_to URL(根据OpenID 2规范的第13节[ http://openid.net/specs/openid-authentication-2_0.html#rp_discovery]).执行此步骤是为了保护用户免受指定域与return_to URL不匹配的攻击.
要消除此错误,您需要通过指定的域字符串支持XRDS发现.根据屏幕截图,这只是意味着在localhost上运行的服务器中添加支持.
基本上,带有application/xrds + xml的Accept HTTP标头的http:// localhost:56709的HTTP请求应该返回X-XRDS-Location的响应HTTP标头,其中包含指定XRDS文件位置的值,或者它可以直接返回XRDS文档.
XRDS文档应该看起来像这样......
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS
xmlns:xrds="xri://$xrds"
xmlns:openid="http://openid.net/xmlns/1.0"
xmlns="xri://$xrd*($v*2.0)">
<XRD>
<Service xmlns="xri://$xrd*($v*2.0)">
<Type>http://specs.openid.net/auth/2.0/return_to</Type>
<URI>http://localhost:56709/return_to/url/path</URI>
</Service>
</XRD>
</xrds:XRDS>
Run Code Online (Sandbox Code Playgroud)
注意:对localhost的HTTP请求将失败,因为无法访问该站点.警告将继续,直到XRDS文档部署到可访问的站点.
归档时间: |
|
查看次数: |
1118 次 |
最近记录: |