Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FOSFacebookBundle and FOSUserBundle working together

I'm developing a website with Symfony2.

I installed FOSUserBundle successfully. Now I would like to install FOSFacebookBundle so that it will work with FOSUserBundle.

I don't really understand the whole "provider user" thing. In the FOSFacebookBundle documentation it says "7. Optionally define a custom user provider class and use it as the provider or define path for login", should I do that to make the two bundles work with each other ? What is that for?

I want to make those two work with each other.

like image 676
httpete Avatar asked Jan 17 '12 19:01

httpete


1 Answers

i recently worked on a project in which i included these two bundles. A user provider is just a class that is responsible for checking auth data. Let's say you have a shop and customers should be able to login, so you have to define a user provider that handles customer entities that are stored in a local database.

But in your case you have Facebook Users that should be able to login. So you define a user provider that can handle these type of users (with the help of the FosFacebookBundle).

It's really simpel. See "Example Custom User Provider using the FOS\UserBundle" chapter further down. You can just copy and paste it into your own bundle.

like image 165
Besnik Avatar answered Nov 07 '22 21:11

Besnik