Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow users of my site to login/register via Facebook and integrate Facebook login system with my own login system?

Tags:

php

facebook

I am just lost and do not know where to begin, please show me documentation I can read to let users register/login to my site using Facebook.

Assuming that

  • I have my own registration/login system

How can I

  • Log in users with their Facebook profile
  • Register users quickly with their Facebook profile if they are not registered

Any ideas or docs are appreciated.

like image 253
Ahmed Fouad Avatar asked May 25 '12 18:05

Ahmed Fouad


People also ask

How do I make someone an authorized login on Facebook?

Tap Security and Login. Tap Use two-factor authentication. Tap Two Factor Authentication. We'll walk you through a few steps to set up login approvals.


1 Answers

First, you need to register an facebook app at https://developers.facebook.com/apps. Then this code will be a good starting point for you:

<iframe src="https://www.facebook.com/plugins/registration?
             client_id=YOUR_APP_ID&
             redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fecho%2F&
             fields=name,birthday,gender,location,email"
        scrolling="auto"
        allowTransparency="true"
        width="100%"
        height="400">
</iframe>

Full documentation of the registration plugin can be found here: https://developers.facebook.com/docs/plugins/registration/

like image 79
Hampus Brynolf Avatar answered Oct 17 '22 00:10

Hampus Brynolf