yahoo 的属性交换 ->空白数据来了
我正在尝试为我的网站构建 openid 登录系统。为此,我使用了 JanRain 的 php openid 库 v 2.1.3 。
我还使用 openid 选择器 从列表中选择 openid 提供程序。
我首先创建了需要从提供程序获取的属性数组,如下所示:
$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',2,1, 'email'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/first',1,1, 'firstname'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/last',1,1, 'lastname'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson',1,1, 'fullname'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/friendly',1,1, 'username'); $ax = new Auth_OpenID_AX_FetchRequest; foreach($attribute as $attr) { $ax->add($attr); } $auth_request->addExtension($ax);
在 finish_auth.php 文件中,我写了这个来获取返回的属性
$ax = new Auth_OpenID_AX_FetchResponse(); $obj = $ax->fromSuccessResponse($response);
Google 为我提供了所请求的所有属性,但 yahoo 没有(如所述这里表示雅虎现在支持属性交换)。
雅虎对属性交换也有任何限制吗? (他们允许有限的网站访问 openid 的 sreg 扩展)。 :(
请帮助我,我被困在这里。
谢谢
I am trying to build openid login system for my website. To do this I used JanRain's php openid library v 2.1.3.
I am also using openid selector to select the openid provider from the list.
I first created the attributes array that I need to fetch from the provider as follows:
$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',2,1, 'email'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/first',1,1, 'firstname'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/last',1,1, 'lastname'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson',1,1, 'fullname'); $attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/friendly',1,1, 'username'); $ax = new Auth_OpenID_AX_FetchRequest; foreach($attribute as $attr) { $ax->add($attr); } $auth_request->addExtension($ax);
and in the finish_auth.php file I wrote this to fetch the attributes returned
$ax = new Auth_OpenID_AX_FetchResponse(); $obj = $ax->fromSuccessResponse($response);
Google gives me all the attributes requested but yahoo doesn't (as stated here that yahoo now supports attribute exchange).
Is there any limitation set by yahoo on attribute exchange too. (they give limited websites access to sreg extension of openid). :(
Please help me, I am stuck over here.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
雅虎的问题已解决!
请查看此处:php-openID 不适用于 Yahoo
Problem for Yahoo is solved !!!
check out here: php-openID doesn't work with Yahoo