Facebook integration for mobile application with basic REST API

We are creating mobile applications (iOS and Android) that require a REST API and Facebook integration for authentication.

I am still confused by what is the best architecture design for this kind of use.

The main question: Who is responsible for authentication / authorization via Facebook, client or server?

Option A: The client authenticates to the FB. The client sends requests using the token received from Facebook. The server uses this token to identify the user.

Option B: The server authenticates to the FB for the benefit of the client.

Additional notes (may or may not be relevant):

  • I am developing a part of the REST API using Django.
  • An application will need access to Facebook users so that we can invite them to use this application.
+4
source share
2 answers

You must go with option A.

  • Authentication with the client. Then you will get an access token.
  • Send this token to the server.
  • Now you can create a user, get FB friends and all that you may need.

If you are using django-rest-framework, you should look at the django-rest-auth package. It processes login / user creation on the server side using an access token.

https://django-rest-auth.readthedocs.org/en/latest/installation.html#social-authentication-optional

+2
source

Facebook SDK Python, , , , (Flask django ).

Facebook , , .

0

Source: https://habr.com/ru/post/1628917/


All Articles