Authentication Setup

StarterAppKit provides built-in support for multiple authentication methods including:

  • Email/Password & Magic Link authentication
  • Google Sign-In
  • Apple Sign-In

Before proceeding, ensure you've followed the Quick Start Guide to:

  • Set up the backend environment
  • Connect the app to your backend

Once those steps are complete, the basic email/password and magic link authentication will work out of the box.

To enable Google and Apple Sign-In, follow the steps below.

Apple Sign-In Setup

Good news: No additional steps are required for Apple Sign-In!

We've already integrated the necessary code to handle Apple authentication. As long as your backend and Apple Developer settings are configured correctly, Apple Sign-In is ready to use.

What does “correctly configured” mean for Apple Sign-In?

Add sign in with apple capability
  • Ensure that Apple Sign-In is enabled in your Apple Developer account for your app’s bundle identifier.

That's it. Apple Sign-In should now work as intended.

Remember to set your app's Bundle identifier in the Backend ( Server Code ) .env file
Note: We have added this Capability by default to StarterAppKit. You only need to re-add it if it's not automatically enabled for your Bundle ID

Google Sign-In Setup

To enable Google Sign-In, you’ll need to provide a few credentials in the iOS app’s Info.plist. This involves:

  1. Obtaining a Google Client ID from the Google Cloud Console
  2. Setting the corresponding URL Schemes in your Xcode project

Steps to Obtain Your Google Client ID

  1. Go to the Google Cloud Console.
  2. Create or select an existing project.
Copy Google credentials
  1. Navigate to the APIs & Services > Credentials section.
  2. Create an OAuth 2.0 Client ID (iOS type).
  3. Copy the generated iOS URL scheme and the Client ID.

Your REVERSED_CLIENT_ID looks something like this: com.googleusercontent.apps.1234567890-abcdefg This reversed ID will serve as your URL Scheme.

Updating the Info.plist

Update info.plist

Location: iosStarterApp/Info.plist

Add the following entries to your Info.plist:

  • URL Scheme: Replace the value of YOUR-GOOGLE-URL-SCHEME with the iOS URL scheme copied from your Google Cloud Console.
  • GIDClientID: Replace the value of YOUR-GOOGLE-CLIENT-ID with the Client ID copied from your Google Cloud Console.

That's All you have to do for the mobile app!

If you don't have the Info.plist updated with your Google credentials, clicking on the Google sign in option will cause the app to crash.

Backend Setup

On the Backend ( Server Code ), you only need to set the value of GOOGLE_CLIENT_ID in your .env file. Once this is set, you should be able to start using Google Auth in your app.

Note: Make sure you test on a real device or run the simulator with appropriate settings. For Apple Sign-In, you must use a device or the simulator logged in with an Apple ID. For Google Sign-In, ensure proper credentials and correct signing & capabilities configuration.