【发布时间】:2014-08-30 16:50:23
【问题描述】:
在我的工作中,我们正在努力将 Zend 1 应用程序迁移到 Symfony 2。我试图弄清楚如何无害地做到这一点。我找到了以下 SF2 捆绑包:https://github.com/mainlycode/Zf1WrapperBundle。我安装了它,按照配置说明,将我的 Zend 应用程序复制到 /vendor/zend 中,一切正常。当我浏览我的旧登录路径时,SF2 无法理解并询问 Zend 的响应,然后出现我的登录表单。我可以登录,它可以正常工作,网站的已验证部分正确显示。
现在我想开始改进需要对用户进行身份验证的功能。所以我创建了一个新的 SF2 包,称为 BackendBundle。它在我的控制器中试过这个:
$securityContext = $this->container->get('security.context');
if( $securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED') ){
echo 'AUTHED';
}
但我收到以下错误:
The security context contains no authentication token. One possible reason may be that there is no firewall configured for this URL.
我完全明白为什么。但是我真的不知道如何“共享” Zend 和 SF2 之间的身份验证。 有什么建议吗?
【问题讨论】:
标签: php symfony authentication zend-framework wrapper