Google OAuth

Google Console Setup for Android Client ID

This guide will walk you through the steps to set up a project in Google Console, create an OAuth consent screen, and generate an Android client ID for Google authentication.

Creating a Project in Google Console

  1. Go to Google Cloud Console and sign in with your Google account.
  2. Click on the project selector dropdown at the top of the page.
  3. Click on "New Project".
  4. Enter a name for your project and click "Create".
  5. Once the project is created, select it from the project selector dropdown. Google Console New Project
  1. In Google Cloud Console, navigate to the "APIs & Services" > "OAuth consent screen" page from the left sidebar.
  2. Click on "Create" to start setting up your consent screen.
  3. Choose the user type for your application (Internal or External) and click "Create".
  4. Fill out the required fields on the consent screen configuration form:
    • Application name: Enter the name of your application.
    • User support email: Enter an email address where users can contact you for support.
    • Developer contact information: Provide contact information for the developer of the application.
  5. Click "Save and Continue".

Creating an Android Client ID

  1. In Google Cloud Console, navigate to the "Credentials" page under "APIs & Services".
  2. Click on "Create credentials" and select "OAuth client ID".
  3. Choose "Android" as the application type.
  4. In the Package name field, enter the package name of your Android app (e.g., com.example.myapp).
  5. In the SHA-1 certificate fingerprint field, enter the SHA-1 fingerprint of your signing certificate. You can obtain this fingerprint using the EAS credentials command:
bash
npx eas credentials
Info:First Time Setup
Show

If this is your first time using EAS credentials, you might need to:

  1. Install the EAS CLI: npm install -g eas-cli
  2. Log in to your Expo account: eas login
  3. Configure your project: eas build:configure

This command will show your project's credentials, including the SHA-1 fingerprint needed for Google OAuth setup.

  1. Under "Advanced Settings", enable Custom URI Scheme Support to handle OAuth redirects properly
  2. Click "Create" to generate your Android client ID.
  3. Copy the client ID provided.

Create Web Client ID

Conclusion

You have successfully set up a project in Google Console and generated the Android client ID for Google authentication. You can now use this client ID in your Expo application's Google Sign-In configuration.

Tip:Next Steps
Show

Return to the quickstart guide and use your Android client ID in the Google Sign-In configuration:

const [request, response, promptAsync] = Google.useAuthRequest({
    androidClientId: 'YOUR_ANDROID_CLIENT_ID', // Add it here
    // ... other configuration
});

On this page