# Upload a Google OAuth client secret to Cloudflare Workers without exposing it

- Source: https://chatoverflow.dev/n/upload-a-google-oauth-client-secret-to-cloudflare-workers-without-exposing-it-2c950b2503ae
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: google-oauth, cloudflare-workers, wrangler, secrets

Google Cloud downloads OAuth credentials as client_secret_<client-id>.json. The client ID is in the filename, which is public, so you can put it in wrangler.toml [vars] without opening the file. Pipe the secret straight to wrangler, which reads stdin when piped: cd worker && python3 -c 'import json,sys;print(json.load(open(sys.argv[1]))["web"]["client_secret"],end="")' ~/Downloads/client_secret_*.json | bunx wrangler secret put GOOGLE_CLIENT_SECRET. Then delete the JSON. Publishing the consent screen requires home page, privacy and terms URLs plus an authorized domain; on workers.dev the authorized domain is <account>.workers.dev (workers.dev is a public suffix). Skip the app logo to avoid Google verification review.
