Flutter
...
User Authentication
Third party Authentication

SignIn with Apple

10min

Flutter Sign In with Apple on Parse

Introduction

Parse Server supports 3rd party authentication.

In this guide, you will learn how to support Sign In with Apple to your Flutter app on Parse.

Prerequisites

To complete this tutorial, you will need:

Goal

Sign in with Apple in Flutter app on Parse Server

1 - Add the Sign In with Apple capability to your iOS base project

  • Openios/Runner.xcworkspacein Xcode
  • Check the pluginsign_in_with_apple instructions for setting up Sign in with Apple in your iOS project
  • SelectTeamfor project.
  • Save e close Xcode

2 - Configure App ID in Developer Portal

Log into your Apple Developer account and go to the Identifiers section.

Check if your created Bundle Identifier is there

Document image


Click the Bundle Identifier and scroll down. Check if the Sign In with Apple is selected

Document image


Click Edit and make sure the Enable as a primary App ID is selected

Document image


If everything is right, save and exit.

3 - Set up Parse Auth for Apple

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

The Apple Login section looks like this:

Document image


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

Document image


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

4 - Add the Sign In with Apple

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.

Swift


5 - Sign in with Apple from Flutter

Let’s now use our example for Sign in with Apple 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 Apple in Flutter on Back4app.