在zend框架中进行身份验证2

时间:2012-04-10 10:09:46

标签: zend-framework2

我将使用Zend Framework 2编写一个身份验证模块。为了帮助我完成这个过程,我找到了这个tutorial in the web。但是,当我运行此模块时,它会显示以下消息:

Class Zend\Authentication\Adapter\AdapterChain does not exist

此消息的含义是什么?

另外,你知道我自己编写的Zend Framework 2身份验证教程可以用来帮助吗?

6 个答案:

答案 0 :(得分:2)

查看ZFC-Common的ZfcAcl

答案 1 :(得分:2)

您可以在zf2中创建自己的自定义插件 Acl implimentation in ZF2

答案 2 :(得分:1)

上面提到的EdpUser已被ZfcUser使用。这与ZF2有关,因为Evan Dot Pro是ZF2的核心贡献者。关于管理Acl,ZfcAcl目前不与ZF2 RC1合作。现在有点落后了。

他们有一个RFC打开来进行更新,但看起来它有点像下线。我可能会建议使用BjyAuthorize。 Zf-Commons也考虑过这个问题。

答案 3 :(得分:0)

试试Authentication + Acl using EventManager。它看起来比ZfcAcl更容易。

答案 4 :(得分:0)

我一个月前也在使用这个教程是旧的,而不是与beta5合作 你可以尝试玩 https://github.com/EvanDotPro/EdpUser它很好地写作并且具有很酷的东西作为登录表单和身份验证状态的视图助手

答案 5 :(得分:0)

我已经在我的一个项目中为此创建了自己的身份验证适配器。我创建了一个gist。您可以像这样使用它:

$adapter = new AdapterChain([
    new \Zend\Authentication\Adapter\Ldap(/* ... */),
    new \Zend\Authentication\Adapter\DbTable(/* ... */)
    // ...
]);

$authService = new AuthenticationService();
$authService->setAdapter($adapter);