The Guard component should be used. http://symfony.com/doc/current/cookbook/security/guard-authentication.html