In my work, we are working on porting our Zend 1 application to Symfony 2. I tried to figure out how to do this harmlessly. I found the following SF2 Bundle: https://github.com/mainlycode/Zf1WrapperBundle . I installed it, followed the setup instructions, copied the Zend application to / vendor / zend, and everything works very well. When I look at my old login, SF2 cannot understand it and ask for an answer to Zend, and my login form will appear. I can log in and it works, part of the site authentication is displayed correctly.
Now I want to start updating the function where the user should be completed. So I created a new SF2 package called BackendBundle. He tried this in my controller:
$securityContext = $this->container->get('security.context');
if( $securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED') ){
echo 'AUTHED';
}
But I get the following error:
The security context contains no authentication token. One possible reason may be that there is no firewall configured for this URL.
I fully understand why. But I really don't know how I can “share” authentication between Zend and SF2. Any suggestions?
source
share