Guide
Google Authentication Setup

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

Creating a Project in Google Console

  1. Go to Google Cloud Console (opens in a new tab) 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.

New Project

Creating an OAuth Consent Screen

  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".

Consent Screen

Consent Screen

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 keytool or Android Studio. You can use the follwing command to get the fingerprint using keytool
keytool -keystore ./android/app/debug.keystore -list -v
  1. Click "Create" to generate your Android client ID.
  2. Copy the client ID provided.

Android Client

Creating a Web Client ID

  1. Navigate to the "Credentials" page under "APIs & Services" in Google Cloud Console.
  2. Click on "Create credentials" and select "OAuth client ID".
  3. Choose "Web application" as the application type.
  4. Click "Create" to generate your web client ID.
  5. Copy the client ID and client secret provided.

Android Client

Creating an iOS 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 "iOS" as the application type.
  4. In the "Bundle ID" field, enter the bundle id of your iOS app, you can get this from XCode or info.plist (e.g., com.example.myapp).
  5. Click "Create" to generate your iOS client ID.
  6. Copy the client ID and iOS URL scheme provided.
  7. Download the plist file and rename it to GoogleService-Info.plist.
  8. Add the GoogleService-Info.plist file to your iOS project.

iOS Client

Conclusion

You have successfully set up a project in Google Console, created an OAuth consent screen, and generated web, Android & iOS client IDs for Google authentication. You can now integrate Google authentication into Android/iOS applications using the provided client IDs.