I am trying to use Symfony's security component in a phalcon project. I read symfony security.yml documentation but I am not sure how that configuration gets injected and how can I make it available in phalcon project.
So far, I have configured TokenStorage as a service in phalcon services.php
/**
* Symfony TokenStorage
*/
$di->setShared( 'tokenStorage', function () use ( $di )
{
$session = $di->getSession();
if ( $session->has( 'tokenStorage' ) )
{
return $session->get( 'tokenStorage' );
} else
{
$session->set( 'tokenStorage', new \Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage(
$di[ 'authProvider' ]
)
);
return $session->get( 'tokenStorage' );
}
}
);
Any help much appreciated. Thanks in advance.