To use FOSFacebookBundle, it's important to understand the Facebook login process, which requires the following steps:
- the user must be logged into Facebook
- the user must connect his Facebook account to your app
- once the user has done 1. and 2., your app must trigger the login
Before continuing, you should go in your application settings on Facebook Developers page and select the option "OAuth Migration". You will have problems if you don't enable it.
To handle authentication, you have two options:
- Use the JavaScript SDK to authenticate the user on the client side;
- Let FOSFacebookBundle redirect to the Facebook login page
Note that the later happens automatically if the first provider in your first firewall configuration is configured to FOSFacebookBundle and the user access a page that requires authentication without being authenticated.
Before you go ahead and use FOSFacebookBundle you should considerer take a look at Facebook and Symfony SecurityBundle documentation: