3
votes

I'm developing a mobile API and I would like to allow mobile users to log in to my mobile application using their Facebook account.

I've been struggling to find some detailed information regarding this request. Could someone point me in the right direction? I'm using the following Laravel package for OAuth2: https://github.com/lucadegasperi/oauth2-server-laravel

As I understand, the user clicks the "Login with Facebook" button and then proceeds to authentication. Facebook provides the access token as a result. But how does a user account appear on our server? And to my knowledge, it is our server that should provide an access token which is tied to the user account on our database. Could someone clear this up?

1

1 Answers

0
votes

Have you looked at the Facebook mobile sdk guides?

iOS: https://developers.facebook.com/docs/ios

Andriod: https://developers.facebook.com/docs/android/

The package you mention looks like it performs oAuth authentication, and I don't think you need that. If I understand correctly, you should be able to use the Facebook sdk to perform the authentication and tell your app that the user is authenticated. You will have to create a user account for them (for example, add a record to the users table in your database) and store their Facebook ID.