From 4767561f02d1bb78b1370233c8519fc18b58afe6 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Thu, 12 Mar 2026 06:56:05 -0300 Subject: [PATCH] docs: add English translation for Remote OAuth section in README (#318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The '🔐 OAuth on a Remote Server' guide existed only in Portuguese (#oauth-em-servidor-remoto). Multiple users (@hijak, @ldsgroups225, @vipinpg) couldn't find it in English. Changes: - Full English step-by-step guide added above the existing PT content - Added 'oauth-on-a-remote-server' anchor (EN) alongside 'oauth-em-servidor-remoto' (PT) - Portuguese version moved into a collapsible
section - OAuthModal.tsx already updated in v2.3.1 to link to #oauth-on-a-remote-server --- README.md | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0bc3228b2f..5a8b9e2d3b 100644 --- a/README.md +++ b/README.md @@ -1508,11 +1508,102 @@ opencode - OmniRoute v1.0.6+ includes fallback validation via chat completions - Ensure base URL includes `/v1` suffix -### 🔐 OAuth em Servidor Remoto (Remote OAuth Setup) +### 🔐 OAuth on a Remote Server + -> **⚠️ IMPORTANTE para usuários com OmniRoute em VPS/Docker/servidor remoto** +> **⚠️ Important for users running OmniRoute on a VPS, Docker, or any remote server** + +#### Why does Antigravity / Gemini CLI OAuth fail on remote servers? + +The **Antigravity** and **Gemini CLI** providers use **Google OAuth 2.0**. Google requires the `redirect_uri` in the OAuth flow to exactly match one of the pre-registered URIs in the app's Google Cloud Console. + +The OAuth credentials bundled in OmniRoute are registered **for `localhost` only**. When you access OmniRoute on a remote server (e.g. `https://omniroute.myserver.com`), Google rejects the authentication with: + +``` +Error 400: redirect_uri_mismatch +``` + +#### Solution: Configure your own OAuth credentials + +You need to create an **OAuth 2.0 Client ID** in Google Cloud Console with your server's URI. + +#### Step-by-step + +**1. Open Google Cloud Console** + +Go to: [https://console.cloud.google.com/apis/credentials](https://console.cloud.google.com/apis/credentials) + +**2. Create a new OAuth 2.0 Client ID** + +- Click **"+ Create Credentials"** → **"OAuth client ID"** +- Application type: **"Web application"** +- Name: anything you like (e.g. `OmniRoute Remote`) + +**3. Add Authorized Redirect URIs** + +In the **"Authorized redirect URIs"** field, add: + +``` +https://your-server.com/callback +``` + +> Replace `your-server.com` with your server's domain or IP (include the port if needed, e.g. `http://45.33.32.156:20128/callback`). + +**4. Save and copy the credentials** + +After creating, Google will show the **Client ID** and **Client Secret**. + +**5. Set environment variables** + +In your `.env` (or Docker environment variables): + +```bash +# For Antigravity: +ANTIGRAVITY_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com +ANTIGRAVITY_OAUTH_CLIENT_SECRET=GOCSPX-your-secret + +# For Gemini CLI: +GEMINI_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com +GEMINI_OAUTH_CLIENT_SECRET=GOCSPX-your-secret +GEMINI_CLI_OAUTH_CLIENT_SECRET=GOCSPX-your-secret +``` + +**6. Restart OmniRoute** + +```bash +# npm: +npm run dev + +# Docker: +docker restart omniroute +``` + +**7. Try connecting again** + +Dashboard → Providers → Antigravity (or Gemini CLI) → OAuth + +Google will now redirect correctly to `https://your-server.com/callback`. + +--- + +#### Temporary workaround (without custom credentials) + +If you don't want to set up your own credentials right now, you can still use the **manual URL flow**: + +1. OmniRoute opens the Google authorization URL +2. After authorizing, Google tries to redirect to `localhost` (which fails on the remote server) +3. **Copy the full URL** from your browser's address bar (even if the page doesn't load) +4. Paste that URL into the field shown in the OmniRoute connection modal +5. Click **"Connect"** + +> This works because the authorization code in the URL is valid regardless of whether the redirect page loaded. + +--- + +
+🇧🇷 Versão em Português #### Por que o OAuth do Antigravity / Gemini CLI falha em servidores remotos?