Facebook + UserBundle authentication with symfony2 Facebook + UserBundle authentication with symfony2 symfony symfony

Facebook + UserBundle authentication with symfony2


An easy and mabye more usable option would be to show all the login options in the login page (including facebook, twitter, open id, or whatever you'd like to use)


Chain providers is indeed the solution to this problem. Here is what you security.yml config shoud look like:

providers:  my_project.chain_provider:    chain:      providers: [fos_userbundle, my_project.facebook_provider]  fos_userbundle:    id: fos_user.user_provider.username_email  my_project.facebook_provider:    id: my_project.user_provider.facebook

And, of course, you need to define your own facebook provider as stated here


You should add the fos_userbundle provider for the form_login (and keep the rest of the configuration):

form_login:    provider: fos_userbundle

I didn't dig too much, but I think Symfony2 is automatically creating a chained provider in this case.