Flutter
...
User Authentication
Third party Authentication

SignIn with Facebook

10min

Setting up Facebook login on your Flutter app using Parse

Introduction

Parse Server supports 3rd party authentication. In this guide you will learn how to setup Facebook authentication/login on your Flutter app using Parse.

Prerequisites

To complete this tutorial, you will need:

Goal

To add Facebook login on your Flutter app using Parse Server

1 - Configure Facebook Login for Android - Quickstart

2 - Configure Facebook Login for Android - Quickstart

3 - Set up Parse Auth for Facebook

Go to Back4App website, log in and then find your app. After that, click on Server Settings and search for the Facebook Login block and select Settings.

The Facebook Login section looks like this:

Document image


Now, you just need to paste your Facebook appId in the field below and click on the button to save.

Document image


In case you face any trouble while integrating Facebook Login, please contact our team via chat!

4 - Add the Sign In with Facebook

Now that you have the project set up, we can get the user data and sign in to Parse.

According to the documentation, we must send a Map with user authentication data.

Dart


5 - Sign in with Facebook from Flutter

Let’s now use our example for Sign in with Facebook in Flutter App, with a simple interface.

Open your Flutter project, go to the main.dart file, clean up all the code, and replace it with:

Dart


Find your Application Id and Client Key credentials navigating to your app Dashboard at Back4App Website.

Update your code in main.dart with the values of your project’s ApplicationId and ClientKey in Back4app.

  • keyApplicationId = App Id
  • keyClientKey = Client Key

Run the project, and the app will load as shown in the image.

Document image


Conclusion

At this stage, you are able to use Sign in with Facebook in Flutter on Back4app.

Updated 24 Jun 2024
Did this page help you?