I am currently in the process of migrating a 2.0.* project to the current 2.1 beta of Symfony.
In my functional tests i currently have this code to create a client w
Proper way to authenticate user is:
$firewallName = 'your-firewall-name';
$container = self::$kernel->getContainer()
$token = new UsernamePasswordToken($user, null, $firewallName, $user->getRoles());
$container->get('security.context')->setToken($token);
and firewall authentication:
$session = $container->get('session');
$session->set('_security_'.$firewallName, serialize($token));
$session->save();