OAuth Setup
ClawPipe supports Google and GitHub sign-in on the dashboard. Both are optional: if no provider credentials are configured, the dashboard gracefully hides the buttons and falls back to email + password. This runbook shows how to enable each provider.
How discovery works
The dashboard calls GET /auth/providers on load. The gateway returns which providers have credentials configured, and the dashboard only renders the buttons for available providers. No code changes required on the frontend.
// Response when only GitHub is configured
{ "google": false, "github": true }
Google OAuth
- Open the Google Cloud Console Credentials page for your project. Create one if needed.
- Click Create Credentials → OAuth client ID.
- Application type: Web application.
- Authorized JavaScript origins:
https://app.clawpipe.ai(and any staging hosts). - Authorized redirect URIs:
https://api.clawpipe.ai/auth/google/callback. - Save. Copy the client ID and client secret.
Set the secrets on the gateway Worker:
# From the gateway/ directory
wrangler secret put GOOGLE_CLIENT_ID
wrangler secret put GOOGLE_CLIENT_SECRET
Redeploy the Worker so the new bindings take effect:
wrangler deploy
GitHub OAuth
- Open GitHub Developer settings → OAuth Apps.
- Click New OAuth App.
- Application name:
ClawPipe. - Homepage URL:
https://clawpipe.ai. - Authorization callback URL:
https://api.clawpipe.ai/auth/github/callback. - Save. On the app page, copy the client ID and generate a new client secret.
Set the secrets on the gateway:
wrangler secret put GITHUB_CLIENT_ID
wrangler secret put GITHUB_CLIENT_SECRET
wrangler deploy
Verify it works
Confirm the discovery endpoint reports the providers:
curl https://api.clawpipe.ai/auth/providers
Open app.clawpipe.ai in an incognito window and confirm the sign-in buttons appear. The complete round-trip is:
- User clicks Continue with Google.
- Browser hits
GET /auth/googleand is redirected to Google's consent screen. - Google redirects back to
/auth/google/callbackwith an auth code. - Gateway exchanges the code, creates or links the user in D1, and sets a session cookie.
- Dashboard loads with the user signed in.
Security notes
- Least privilege. Both providers issue tokens scoped only to
profileandemail. ClawPipe never requests repo or drive scopes. - Rotation. Rotating a client secret is a single
wrangler secret putplus redeploy — no downtime if you rotate during low traffic. - Audit. OAuth link events are written to the
oauth_accountstable in D1. Existing sessions are unaffected when a secret rotates. - Removal. To fully disable a provider, delete both secrets and redeploy. The dashboard auto-hides the button on the next load.
Troubleshooting
- Buttons do not appear. Check
curl https://api.clawpipe.ai/auth/providers— both fields must returntrue. Iffalse, the secrets are missing or the Worker has not been redeployed since they were set. - Redirect URI mismatch. The callback URL in the provider console must exactly match
https://api.clawpipe.ai/auth/{provider}/callback, including protocol. - Sign-in loops back to login. Session cookies require the
api.clawpipe.aiandapp.clawpipe.aihosts to share a cookie domain. Confirm the Worker setsDomain=.clawpipe.aion the session cookie.