Login with facebook

Asked

Viewed 269 times

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 let the system know when to register or log in? For example, I enter 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 data already recorded, how do I do it?

1 answer

2

First you need to register your application on facebook: https://developers.facebook.com/

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

Done this you can use a bilioteca to implement the Oauth or do on hand (http://oauth.net/2/)

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

https://github.com/fernandezpablo85/scribe-java

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.