yahoo 的属性交换 ->空白数据来了

发布于 2024-08-18 23:14:00 字数 1436 浏览 5 评论 0原文

我正在尝试为我的网站构建 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冬天的雪花 2024-08-25 23:14:00

雅虎的问题已解决!
请查看此处:php-openID 不适用于 Yahoo

Problem for Yahoo is solved !!!
check out here: php-openID doesn't work with Yahoo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文