zend框架中的身份验证2

问题描述:

我打算使用Zend Framework 2编写一个身份验证模块。为了帮助我完成此过程,我找到了tutorial in the web。但是,当我运行此模块时,它显示此消息:zend框架中的身份验证2

Class Zend\Authentication\Adapter\AdapterChain does not exist 

此消息的含义是什么?

此外,你知道我可以使用Zend Framework 2身份验证教程,因为我写我自己的?

看看ZFC-Common的ZfcAcl

+0

嗨,谢谢你的回答。但zfcacl对我来说非常困难。我是一个zend框架的初学者。 – mohsen 2012-04-10 12:32:42

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

我也是用这个教程一个月前是旧的,不与beta5的
工作,就可以尝试用
https://github.com/EvanDotPro/EdpUser发挥它很好writen,并有很酷的事情是视图助手的登录表单,并权威性地位

如上所述的EdpUser已被ZfcUser使用。由于Evan Dot Pro是ZF2的核心贡献者,因此ZF2将起作用。关于Acl的管理,ZfcAcl目前不支持ZF2 RC1。现在有点落后了。

他们有一个开放的RFC来进行更新,但看起来像是一个小小的方式。我可能会推荐使用BjyAuthorize。 Zf-Commons也在考虑考虑这一点。

你可以这样 Acl implimentation in ZF2

我已经创造了这个我自己的身份验证适配器在我的项目之一创建ZF2的东西你自己定制的插件。我创建了一个gist。你可以这样使用它:

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

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