Set up Google OAuth with Omni

This covers setting up an SSO connection with your Google app. The general process will be:
  1. Creating an OAuth Client ID in Google
  2. Verifying your Google account domain
  3. Configuring the application with your OmniAI callback url
To get started, visit: https://console.developers.google.com/apis/credentials If you already have a Google project configured, proceed to Creating a client. Otherwise first follow the steps to create a new project.

1. Create a new project

From the Google Console, create a new project. Create a new project

2. Create an Oauth ID

Under the Create Credentials section, create a new Oauth Client ID. Create an Oauth ID Click “Configure Consent Screen” and create an External app. Configure consent screen

4. Configure app details

Configure the app details. Configure app details

5. Authorize a Domain

Authorize a domain to use the OmniAI callback url. Authorize a Domain

6. Add permission scope

For the Omni authentication, we will just need the top level public permissions.
  • /auth/userinfo.email
  • /auth/userinfo.profile
  • openid
Add permission scope Add permission scope 2

7. Optional: Add test users

Add test users to the OmniAI application. Add test users

8. Complete Registration

App registration is now complete. Scroll to the bottom and click “Back to Dashboard” Complete registration

9. Publish App

From the dashboard you can click into your newly created app and click “Publish App” Publish app

10. Creating an OAuth Client

Once you have a Google project created, you can select OAuth Client ID again Create a new oauth client Select the “Web Application” type. And add https://[your url]/api/auth/callback/google as the redirect URL. Create a new oauth client 2

11. Save Client ID and Secret

Once created, save down the Client ID and Secret. Copy client ID and secret

12. Add Client ID & Secret to Docker Compose

To enable Google SSO, add the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to the Docker container environment vatiables.
version: '1.01'
services:
app:
  image: omniai:latest
  container_name: omniai
  ports:
    - '3000:3000'
    - '4000:4000'
  volumes:
    - pgdata:/var/lib/postgresql/16/main
  environment:
    - OMNI_PRODUCT_KEY=12345
    - GOOGLE_CLIENT_ID=12345
    - GOOGLE_CLIENT_SECRET=12345
volumes:
pgdata:
  name: omni_pg_data