Skip to main content

Google Auth

Expo Documentation

Prerequisites

  • A Gmail Account, e.g.: example.app@gmail.com
  • A Firebase Account ( must be created with the same Gmail)
  • A Google Cloud Platform Account (must be created with the same Gmail)
  • A Supabase Account created with the same email (recommended, but not mandatory)

Create a new project on Google Cloud

  1. Visit: Google Cloud Console
  2. Sign in with your Gmail Account.
  3. In the top navbar, open the project selector and click “New Project”:

create-gcp

  • Choose a name for the project:

choose-name

caution

This step is required for Firebase to generate clients, API keys, and service accounts. Without it, Firebase cannot proceed.

  • Navigate to APIs & services > Credentials and click “Configure consent screen”

configure

  1. Fill in the required fields:
    • App name
    • Support Email
    • In the section “Audience”, select “External”.

fill-fields

  1. Click Create to complete the setup.
  2. Back on the “Audience” section and click “Publish App

publish-app

Create the project on Firebase

Once the consent screen is configured:

  1. Go to Firebase Console
  2. Click “Add Firebase to Google Cloud project”

firebase

  1. Choose the Google Cloud Platform project you created earlier:
caution

Important: This allows Firebase to automatically generate clients, API keys, and service accounts. Otherwise, you’ll need to create them manually (not recommended).

bind-firebase-with-gcp

iOS Configuration

HOW TO FIND APP ID AND TEAM ID? By selecting the app on the App Store Connect, you can find the app’s App ID in the address bar and the Team ID in the membership details.

ios-config

  • Download GoogleService-Info.plist file.

service-plist

caution

If you update the configuration, re-download the file. You can always re-download it from Project Settings.

redownload-plist

Enable Authentication > Sign in method > Google

enable-the-google-provider

After creating the iOS Firebase project and enabling the provider, Firebase will automatically generate everything necessary for configuration:

generated-info

Android Configuration

You must insert the SHA-1 certificate — without it, sign-in won't work and will throw a DEVELOPER_ERROR.

Firebase will generate a separate client for each certificate.

It is normal to have multiple clients for different certificates.

info

For detailed instructions on generating SHA-1 certificates for different environments (EAS Build, Google Play Store, local development), see our comprehensive SHA-1 Certificate guide.

Quick EAS Setup: To generate the SHA-1 certificate for your Android app, you can use the following command if you are using EAS:

eas credentials

This command will guide you through the process of creating or updating your credentials, including the SHA-1 fingerprint. You can find the generated SHA-1 certificate in your Expo account's credentials section.

android-app

Configure Supabase

Expo Supabase Documentation

Supabase Google Provider Documentation

  1. Create a new Supabase project
  2. Go to Supabase Dashboard > Authentication > Sign In / Providers > Google
  3. Enable the Google Provider
  4. Enable the option “Skip nonce checks” (recommended for mobile app)
  5. Copy Client IDs and Client Secret from the Web application type client generated by Firebase and enter them in the Supabase fields.

configure-supabase

Configure Google Services files (React Native)

https://rnfirebase.io/#local-app-compilation

configure-service-json

app.config.ts
// other code

const googleServices = () => {
return {
android: `./configs/firebase/${path}/google-services.json`,
ios: `./configs/firebase/${path}/GoogleService-Info.plist`,
};
};

const config = {
expo: {
// other expo config
ios: {
// other configs
usesAppleSignIn: true,
bundleIdentifier,
googleServicesFile: googleServices().ios,
// other configs
},
android: {
// other configs
package: bundleIdentifier,
googleServicesFile: googleServices().android,
// other configs
},
plugins: [
//other plugins

'@react-native-firebase/app',
[
// Needed for firebase
'expo-build-properties',
{
ios: {
useFrameworks: 'static',
},
},
],
],
},
};

Configure Google Sign-In (React Native)

React Native Google Sign-In Documentation

caution

Don’t add unused scopes to the configuration, you may encounter “Unverified App” error:

Add this in app.config.ts in expo.plugins:

app.config.ts
[
'@react-native-google-signin/google-signin',
{
// This value is the REVERSED_CLIENT_ID from the GoogleService-Info.plist file
iosUrlScheme: IosSchemeUrl,
},
],