我正在尝试为我的网站构建OpenID登录系统。为了做到这一点,我用了
JanRain's php openid library
V2.1.3.
我也在用
openid selector
从列表中选择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);
谷歌给了我所有要求的属性,但雅虎没有(如前所述
here
雅虎现在支持属性交换)。
雅虎对属性交换也有什么限制吗?(他们给有限的网站访问OpenID的SReg扩展)。:。(
请帮帮我,我被困在这里了。
谢谢