I might have finally got an answer to this. The code for the login part is indeed already defined in the FOSUserBundle. I looked at the routing of my own project and can see that it looks like this:
fos_user_security_login:
pattern: /login
defaults: { _controller: FOSUserBundle:Security:login }
//Check a login:
fos_user_security_check:
pattern: /login_check
defaults: { _controller: FOSUserBundle:Security:check }
methods: [POST]
//The logout route:
fos_user_security_logout:
pattern: /logout
defaults: { _controller: FOSUserBundle:Security:logout }
Now, these routes all point to the SecurityController of the bundle with those methods in it. This class can be found in /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Controller/SecurityController.php and the routing can be found in /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Resources/config/routing/security.xml (I converted it in this post to YAML for easier understanding).
So, the only thing you need to do is do a reference (import) in the routing file in the app folder to this security.yml file.
To answer your question: I don't think you need to define these in your own controller as they're already defined in the above mentioned files.
If I can find more details I'll post them ASAP. Been a while that I used this bundle. I now use the builtin Symfony2 elements, which I find more transparent in the long run.
Edit: In the routing file of my own bundle I have the references to those XML files:
// FOSUser files
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: user/profile
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: user/register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: user/resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: user/profile