Skip to content

Allow a shared deployment OAuth client for authenticated users#1713

Open
aryeh-stark wants to merge 1 commit into
BuilderIO:mainfrom
21-Stark-AI:upstream/shared-oauth-client
Open

Allow a shared deployment OAuth client for authenticated users#1713
aryeh-stark wants to merge 1 commit into
BuilderIO:mainfrom
21-Stark-AI:upstream/shared-oauth-client

Conversation

@aryeh-stark

Copy link
Copy Markdown
Contributor

Problem

OAuth client credentials (GOOGLE_CLIENT_ID/SECRET, GOOGLE_SIGN_IN_CLIENT_*, GITHUB_CLIENT_*) are deployment-wide identity, not per-tenant secrets: every user authorizes the same app for their own account and gets their own tokens. But resolveSecret refuses the deploy-env fallback for any authenticated user in a hosted runtime — correct for per-tenant API keys, wrong for a shared OAuth client.

Result: a deployment that sets GOOGLE_CLIENT_* has working Google sign-in for anonymous requests but /google/auth-url returns missing_credentials the moment a user has a session, and each logged-in user is shown the "bring your own OAuth app" setup wizard.

Fix

resolveSecret now lets OAuth-client keys fall back to the deploy env even for signed-in users (same treatment Builder credential keys already get). A per-tenant client (BYO upload) still wins — user/org/workspace scopes are resolved first. Also fixes GoogleConnectBanner computing "configured" across every env key (Slack/Resend/LLMs) instead of just the Google client keys.

Tests + changeset.

OAuth client credentials (GOOGLE_CLIENT_ID/SECRET, GOOGLE_SIGN_IN_CLIENT_*,
GITHUB_CLIENT_*) are deployment-wide identity, not per-tenant secrets: every
user authorizes the same app for their own account and gets their own tokens.
But resolveSecret refused to fall back to the deploy env for signed-in users in
a hosted runtime, so a deployment that set GOOGLE_CLIENT_* still showed each
logged-in user the "bring your own OAuth app" setup wizard and /google/auth-url
returned missing_credentials. Let these keys use the deploy env fallback (same
as Builder credential keys); a per-tenant BYO client still wins (resolved
first). Also fix GoogleConnectBanner computing "configured" across every env
key (Slack/Resend/LLMs) instead of just the Google client keys.
@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

@steve8708

Copy link
Copy Markdown
Contributor

great improvement, thanks @aryeh-stark! just need lint to pass on this one too and good to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants