# Google login

Openfort Auth supports Sign in with Google on the web, native Android applications, and Chrome extensions.

## Overview

Setting up Google logins for your application consists of three parts:

* Create and configure a Google Project and App on the [Google Cloud Platform](https://console.cloud.google.com/home/dashboard).
* Add your Google API Key and API Secret Key to your [Openfort Project](https://dashboard.openfort.io/providers).
* Add the login code to your [Openfort JS Client App](https://github.com/openfort-xyz/openfort-js).

### Web configuration

#### Google pre-built configuration

1. Go to the [API Credentials page](https://console.cloud.google.com/apis/credentials).
2. Click **Create credentials** and choose **OAuth Client ID**.
3. For application type, choose **Web application**.
4. Under **Authorized redirect URLs**, enter the callback URL from the [Openfort dashboard](https://dashboard.openfort.io/providers). Expand the Google Auth Provider section to display it.
5. When you finish configuring your credentials, the console displays your client ID and secret. Add these to the Google Auth Provider section of the Openfort Dashboard.

<div align="center">
  <img width="70%" height="70%" src="https://www.openfort.io/images/blog/googleauth_729cabb623.png" alt="Google provider configuration in Openfort dashboard" />
</div>

### Expo React Native configuration

1. Configure OAuth credentials for your Google Cloud project in the [Credentials](https://console.cloud.google.com/apis/credentials) page of the console. When creating a new OAuth client ID, choose **Android** or **iOS** depending on the mobile operating system your app is built for.
   * For Android, use the instructions on screen to provide the SHA-1 certificate fingerprint used to sign your Android app. You have a different set of SHA-1 certificate fingerprints for testing locally and for production. Add both to the Google Cloud Console and add all of the Client IDs to Openfort dashboard.
   * For iOS, use the instructions on screen to provide the app Bundle ID, and App Store ID and Team ID if the app is already published on the Apple App Store.
2. Configure the [OAuth Consent Screen](https://console.cloud.google.com/apis/credentials/consent). This information is shown to the user when giving consent to your app. Make sure you have set up links to your app's privacy policy and terms of service.
3. Add the client ID from step 1 in the [Google provider on the Openfort Dashboard](https://dashboard.openfort.io/providers), under **Client IDs**.

You do not have to configure the OAuth flow in the Openfort Dashboard to use native sign in.
