Zend Framework open id extensions with google

[亡魂溺海] 提交于 2019-12-08 10:37:46

问题


How to use openid extensions with google? I have something like this, I allready applied some patches which are basically the same as here: http://ak33m.com/?p=71

It does work without extensions?

$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:


Maybe having a look at an example ZF 1.11 application that uses OpenID (including google) for authentication will clarify how to make it work (source code is also available).



来源:https://stackoverflow.com/questions/5310860/zend-framework-open-id-extensions-with-google

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!