问题
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