---
title: "Google OAuth"
description: "Configure Google OAuth for secure Single Sign-On with your Formbricks instance. Implement enterprise-grade authentication for your survey platform with Google credentials."
icon: "google"
---

<Note>Google OAuth is part of the Formbricks [Enterprise Edition](/self-hosting/advanced/license)</Note>

### Google OAuth

Integrating Google OAuth with your Formbricks instance allows users to log in using their Google credentials, ensuring a secure and streamlined user experience. This guide will walk you through the process of setting up Google OAuth for your Formbricks instance.

### Requirements

- A Google Cloud Platform (GCP) account

- A Formbricks instance running

### How to connect your Formbricks instance to Google

{/* prettier-ignore-start */}

<Steps>
  <Step title="Create a GCP Project">
    - Navigate to the [GCP Console](https://console.cloud.google.com/).
    - From the projects list, select a project or create a new one.
  </Step>

  <Step title="Setting up OAuth 2.0">
    - If the **APIs & services** page isn't already open, open the console left side menu and select **APIs & services**.
    - On the left, click **Credentials**.
    - Click **Create Credentials**, then select **OAuth client ID**.
  </Step>

  <Step title="Configure OAuth Consent Screen">
    - If this is your first time creating a client ID, configure your consent screen by clicking **Consent Screen**.
    - Fill in the necessary details and under **Authorized domains**, add the domain where your Formbricks instance is hosted.
  </Step>

  <Step title="Create OAuth 2.0 Client IDs">
    - Select the application type **Web application** for your project and enter any additional information required.
    - Ensure to specify authorized JavaScript origins and authorized redirect URIs.

    ```
    Authorized JavaScript origins: {WEBAPP_URL}
    Authorized redirect URIs: {WEBAPP_URL}/api/auth/callback/google
    ```

  </Step>

  <Step title="Save persistent configuration">
    Set `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` in the configuration that creates your app containers.
    With Compose, reference protected `.env` values from the app's `environment` block:

    ```yaml
    environment:
      GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
      GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
    ```

    With Kubernetes, use your deployment's Secret bindings. Keep credentials out of Git and shared logs.
    An export in a `docker exec` shell does not configure the running application or survive recreation.
  </Step>
  <Step title="Apply and verify">
    Recreate the app during your planned configuration window:

    ```bash
    docker compose up -d --no-deps --force-recreate formbricks
    ```

    On Kubernetes, roll out the updated deployment through Helm or GitOps. Test Google sign-in in a fresh
    browser session and confirm the callback uses your public `WEBAPP_URL`.
  </Step>
</Steps>

{/* prettier-ignore-end */}
