FOSFacebookBundle
FOSFacebookBundle copied to clipboard
Authentication using FBToken & FBUserId
FOSFacebookBundle provide a way to do a authenticate user using Facebook. This is done by many steps define on README :
Note that logging in a user requires multiple steps:
- the user must be logged into Facebook
- the user must connect his Facebook account to your site
- once the user has done 1. and 2. you must trigger the login
For step 1. and 2. there are two options:
- Select "OAuth Migration" in the Facebook application settings.
- Add a Facebook login button, this approach requires JS code to handle step 3.
- Letting the FOSFacebookBundle redirecting to the Facebook login page
This module doesn't provide any method to authenticate a FBUser is the user have already a FBToken & a FBUserId. Do you think that it could be a good thing if the FOSFacebookBundle provide a way to authenticate a FBUser using HTTP Header to pass FBToken & FBUserId ?
I have already build my own Bundle to do that. I'm wondering if it could be accept if I do a pull-request for this ?
This is related to the remember_me behavior built into the security system. It should not be mixed with the default authentication but it should be available separately. I've also implemented it, persisting the access_token and user_id into a cookie and setting them back into facebook before calling getUser(). I had to create a new TokenBasedRememberMeServices class in order to achieve this, as the default remember_me behavior is to only persist the user ID. I can also provide some pointers if you want to go in this direction.