Zend Framework使用谷歌开放id扩展

时间:2011-03-15 11:13:31

标签: zend-framework openid

如何在google上使用openid扩展程序?我有类似的东西,我已经应用了一些与此处基本相同的补丁:http://ak33m.com/?p=71

它没有扩展功能吗?

$extensions = new Zend_OpenId_Extension_Sreg(array(
    'nickname' => false,
    'email' => true,
    'fullname' => false
    ),
    null,
    '1.1'
    );

if ($form->isValid($post)) {

$open_id_adapter = new App_Auth_Adapter_OpenId($post['openid_identifier'],null, null, null, $extensions);
$result = $auth->authenticate($open_id_adapter);

} else {                                

$open_id_adapter = new App_Auth_Adapter_OpenId(null, null, null, null, $extensions);
$result = $auth->authenticate($open_id_adapter);
}
if ($result->isValid()) {
$this->_helper->flashMessenger->addMessage(array(
    'message' => 'U bent ingelogd',
    'status' => 'success'
));
} 

1 个答案:

答案 0 :(得分:1)

也许看一下使用OpenID(包括谷歌)进行身份验证的example ZF 1.11 application将阐明如何使其工作(源代码也可用)。