Zend Framework 与 google 一起开放 id 扩展

发布于 2024-10-22 18:33:58 字数 882 浏览 0 评论 0原文

如何在 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'
));
} 

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'
));
} 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

舂唻埖巳落 2024-10-29 18:33:58

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).

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