CodeIgniter Forums

Full Version: How to integrate Facebook Connect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hey guys.

Im trying to integrate the facebook API so that users can log onto my site using facebook and have come into some problems in how im thinking.

My question is how does this actually work with regards to the database?

I have existing users as well as new users that i want to be able to log in with facebook. However, with the existing users, how do I know which user the facebook information relates to. Obviously, if they click the "login with facebook icon" then I have none of their information from my own database.

Also, with new users, do i have to store another field in my database now - user_id as well as facebook_id to compare against to see which user it is?

Any thoughts much appreciated.
Cheers :-)

El Forum

[eluser]Jamie Rumbelow[/eluser]
Once they've authenticated with Facebook for the first time, you should get them to fill in a small bit of information on your site too. That way you can also give them the option to connect their current account with their Facebook account. New users have a Facebook-initiated account and current users connect their Facebook account to their account your site.


El Forum

[eluser]RaZoR LeGaCy[/eluser]
Hey Jamie, is there a detailed guide that you know of because I have the same issue. Just unsure in the grans scheme of things. I can google but cool if you knew a full tutorial about integrating with existing users DB.

Thank you