Skip to content

About

ChatAI-Console browser extension for automating oauth

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ChatAI Console — OAuth Bridge Extension

A browser extension (Manifest V3) that serves two distinct purposes for ChatAI Console:

  1. Google sign-in bridge — enables OAuth sign-in for Claude.ai, 1min.AI, and Flowith.io accounts without requiring manual cookie or token extraction.
  2. Token extraction — extracts JWT tokens from ChatAIBotPro cookies for seamless authentication.
  3. Cloudflare clearance relay — silently relays the cf_clearance cookie back to Console when the 1min.AI API returns a Cloudflare challenge during normal chat usage. This is not a sign-in flow.

Disabled by default. Enable the bridge from the popup when signing in or when actively chatting through 1min.AI. Content scripts exit immediately when the toggle is off.


Why this exists

Google only issues sign-in tokens to origins registered with a given OAuth client ID. Claude's, 1min.AI's, and Flowith's client IDs are registered for their own domains — not localhost. This extension bridges that gap: sign-in happens from the correct origin, and the resulting credential is forwarded to your local ChatAI Console server. Nothing is sent anywhere else.


Sign-in flows

These run only when you explicitly click a "Sign in with Google" button inside ChatAI Console. The content scripts do nothing on ordinary visits to these sites.

Claude.ai — authorization-code flow

  1. Click Sign in with Google for Claude in ChatAI Console.
  2. Console registers a pending session (state) and opens claude.ai.
  3. content_claude.js polls GET /api/oauth/claude/ext-pending.
  4. On detection, it calls google.accounts.oauth2.initCodeClient using Claude's own registered GIS client (already loaded on claude.ai) and opens a Google sign-in popup.
  5. Google returns a one-time authorization code to the callback.
  6. The script POSTs { state, code } to POST /api/oauth/claude/ext-callback.
  7. Console exchanges the code for a Claude session and fills the account form.

1min.AI — hash-redirect access-token flow

  1. Click Sign in with Google for 1min.AI in ChatAI Console.
  2. Console registers a pending session and opens app.1min.ai.
  3. content_1minai.js polls GET /api/oneminai/ext-pending.
  4. On detection, it fetches the Google auth URL from Console and opens a sign-in popup.
  5. After authentication, Google redirects to app.1min.ai/#access_token=ya29.…&refresh_token=….
  6. The landing-page handler reads tokens from location.hash and POSTs { state, access_token, refresh_token, user_id } to POST /api/oauth/flowith/ext-callback.
  7. Console exchanges the access token for a 1min.AI JWT and saves the account.

Flowith.io — Supabase hash-redirect JWT flow

  1. Click Sign in with Google for Flowith in ChatAI Console.
  2. Console registers a pending session and opens flowith.io.
  3. content_flowith.js polls GET /api/oauth/flowith/ext-pending.
  4. On detection, it fetches the Supabase authorize URL from Console and opens a sign-in popup.
  5. After authentication, Supabase redirects to flowith.io/#access_token=eyJ…&refresh_token=….
  6. The landing-page handler reads tokens from location.hash and POSTs { state, access_token, refresh_token, user_id } to POST /api/oauth/flowith/ext-callback.
  7. Console parses the JWT and saves the Flowith account.

ChatAIBotPro — token cookie extraction

  1. Click Sign in with ChatAIBotPro in ChatAI Console.
  2. Console registers a pending session and opens chataibot.pro.
  3. content_chataibotpro.js polls GET /api/oauth/chataibotpro/ext-pending.
  4. On detection, it reads the token cookie from chataibot.pro.
  5. The script POSTs { state, token } to POST /api/oauth/chataibotpro/ext-callback.
  6. Console stores the JWT token and saves the ChatAIBotPro account.

Cloudflare clearance relay — separate from sign-in

This mechanism is automatic and background-only. It is not triggered by user action; it activates only when Console encounters a Cloudflare challenge while making a 1min.AI API call on your behalf during normal chat usage.

How it works

  1. Console sends a request to the 1min.AI API. The API returns a Cloudflare challenge (HTTP 403/503) instead of the expected response.
  2. Console detects the block, registers a pending CF challenge with a unique state token, and opens an overlay showing app.1min.ai in a popup so you can complete the Cloudflare checkbox.
  3. The content script on app.1min.ai polls GET /api/oneminai/cf-pending (only while the bridge is enabled) and detects the waiting state.
  4. The script sends a get_cf_clearance message to the background service worker — the only browser context with access to the cookies API.
  5. The background worker reads the cf_clearance cookie for https://1min.ai (set by Cloudflare after you complete the checkbox) and returns its value.
  6. The script POSTs { state, cf_clearance } to POST /api/oneminai/cf-callback.
  7. Console stores the cookie on the account and retries the original blocked request automatically. The overlay closes.

The cf_clearance cookie is read only when Console explicitly registers a pending challenge — never during ordinary browsing.


Installation

Chrome / Edge / Brave / Chromium

  1. Open chrome://extensions
  2. Enable Developer mode
  3. Click Load unpacked and select this directory

Firefox

  1. Open about:debugging#/runtime/this-firefox
  2. Click Load Temporary Add-on and select manifest.json

Firefox temporary add-ons must be reloaded after each browser restart.


Usage

Sign in to Claude: Enable bridge → Add Account (Claude) → Sign in with Google for Claude → complete popup → disable bridge when done.

Sign in to 1min.AI: Enable bridge → Add Account (1min.AI) → Sign in with Google for 1min.AI → complete popup → disable bridge when done.

Sign in to Flowith: Enable bridge → Add Account (Flowith) → Sign in with Google for Flowith → complete popup → disable bridge when done.

Sign in to ChatAIBotPro: Enable bridge → Add Account (ChatAIBotPro) → Sign in with ChatAIBotPro → token is extracted automatically → disable bridge when done.

Cloudflare challenge (1min.AI): Keep the bridge enabled while chatting via 1min.AI. If a challenge appears, complete the Cloudflare checkbox in the popup that Console opens. The relay is automatic — you do not need to click anything in the extension.


Security

Property Detail
No external servers All data goes only to your configured Console URL.
No background polling when disabled Content scripts exit immediately when the toggle is off.
No persistent token storage Credentials are relayed once and not stored by the extension.
Cookies on demand only cf_clearance is read only when Console signals an active Cloudflare challenge.
State verification Every flow uses a random state generated by Console to match responses to the correct request.
No analytics Zero telemetry of any kind.

Permissions

Permission Reason
https://claude.ai/* Content script for Claude sign-in
https://app.1min.ai/* Content script for 1min.AI sign-in and CF clearance relay
https://flowith.io/* Content script for Flowith sign-in
https://chataibot.pro/* Content script for ChatAIBotPro token extraction
Console URL Communicate with ChatAI Console
storage Persist enabled toggle, consent flag, server URL
tabs Open Console in a new tab from the popup
cookies Read cf_clearance for app.1min.ai in the background service worker — only when Console signals a pending Cloudflare challenge

Files

File Purpose
manifest.json Extension manifest (MV3)
background.js Service worker — first-install onboarding; cf_clearance cookie relay
content_claude.js Claude.ai — GIS authorization-code sign-in flow
content_1minai.js 1min.AI — hash-redirect token sign-in flow + Cloudflare clearance relay
content_flowith.js Flowith.io — Supabase hash-redirect JWT sign-in flow
content_chataibotpro.js ChatAIBotPro — token cookie extraction
popup.html / popup.js Extension popup
onboarding.html / onboarding.js First-install consent and setup page
gsi_client.js Bundled Google Identity Services client (used by Claude flow)

Troubleshooting

Console shows offline → Make sure python app.py is running at the configured URL.

Claude popup opens but nothing is captured → Allow popups for claude.ai. Enable the bridge before clicking sign-in.

1min.AI token not captured → Enable the bridge before clicking sign-in. Confirm the redirect URL contains #access_token=.

Cloudflare overlay never resolves → The bridge must be enabled. Complete the full Cloudflare checkbox in the popup Console opened. If the cookie still does not arrive, reload app.1min.ai in the popup with the bridge on.

Flowith token not captured → Enable the bridge before initiating sign-in in Console. Confirm the post-auth URL contains #access_token=.

ChatAIBotPro token not captured → Enable the bridge before clicking sign-in. Make sure you're logged in to chataibot.pro. Check that the token cookie exists in DevTools → Application → Cookies.


License

MIT — see LICENSE

About

ChatAI-Console browser extension for automating oauth

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages