Login with facebook

1

I have a question regarding login through Facebook.

I have a database with a users table and I have a normal registration and login system, but I wanted to implement the login system through Facebook.

How do I tell the system when to register or log in? For example, I enter with Facebook the first time and the site has to create a space in the database for me but the second time it should access my already registered data, how do I do this?

    
asked by anonymous 19.05.2015 / 23:36

1 answer

2

First you need to register your application on facebook: link

After this you will have an api-key and api-secret that identify your application on facebook.

Once you've done this you can use a library to implement OAuth or do it by hand ( link )

I'm studying the following Java library to log in and publish on face:

  

link

When the user logs in for the first time, he authorizes access, and after that every time he accesses, the authorization will no longer be requested. That is, you will save the authorization token in your database so you no longer need to ask for the next access.

    
20.05.2015 / 00:21