-
Notifications
You must be signed in to change notification settings - Fork 140
Using FOSFacebookBundle to bind "fosuserbundle users" to facebook accounts #145
Comments
I think for now its fine to put it into the README. splitting things up should imho be done in a second step if necessary. |
Ok, great. This will also fix an issue when a user is already registered and wants to login with his Facebook account having the same email adress. |
Thanks for the help! I also thought of using the email address for identifying already registered users. I think the problem with this solution is that email match is an effective but not sufficient condition: what if the user registered to his facebook account with a different email address than the one he used for the website? One solution I thought of is trying to store the user's ID in the session before the authentication process hits and the "check_path" disconnects the user, so that I can use the stored ID in the FacebookProvider to identify the user. An other more "handcrafty" solution would be to design a different facebook button which does not even use authentication on symfony. After facebook oauth, the button would point to a controller which would recover the info stored in the "fbsr_" cookie using the facebook SDK, and modify the user entry in the manager. What do you think would be the most efficient? |
I used the email condition to prevent an validation error as email_canonical is defined as unique. But I agree it isn't sufficient. Another, third, solution would be: Still have the normal and Facebook login page but add a new button to the users profile edit page to connect the account. This could be handled independently from the registration process. |
Hello! I'm crazy with this bundle. I have did all the indications of Readme. I use symfony2.1.3-dev.
routing.yml
security.yml
In my base.html.twig I included:
And in one of the page of login(FOSUserBundle) included: ( with this line code, the user can log on facebook, from my web)
But I don't know how complete the field facebookId and asociate an user facebook - my web |
Currently, the custom provider presented in the documentation creates a new user in the FOSUserBundle database, with all its user info extracted from facebook. (basically, the facebookId, email, first and last name)
Would there be an accessible way to use this bundle so that, when a user that has logged in through the form login connects itself for the first time with the facebook button, it updates its database record with new info (in appropriate nullable fields added in the user entity), instead of creating yet another user?
Therefore a user could only login to the website through the form, but this user would then be able to "bind" their website account to their facebook account, if they want to.
Yet I cannot seem to get a firm conviction that this bundle allows to process such a thing without fiddling consistently with its core components...
The text was updated successfully, but these errors were encountered: