claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] Preview: Allow configurable external URL whitelist for OAuth and other third-party required flows

Open edumansky opened this issue 9 months ago • 46 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The new App Preview feature in Claude Code on desktop restricts all navigation to localhost URLs only. When a locally running web application initiates an OAuth flow that requires navigating to a third-party identity provider (e.g., idbroker.webex.com, accounts.google.com, login.microsoftonline.com), the Preview browser blocks the outbound navigation with the message:

⚠️ Link to webexapis.com was blocked. Preview only supports localhost URLs.

This makes it impossible to develop or test any application that relies on third-party OAuth/SSO authentication flows within the Preview panel.

Proposed Solution

Add a configurable external URL allowlist for the Preview browser. This could be specified at the project level (e.g., in .claude/settings.local.json or a dedicated preview config) or via the desktop app settings.

Alternative Solutions

Alternative Why It's Not Ideal
Use Claude in Chrome (--chrome) Loses the inline Preview experience; requires switching to an external browser window. Defeats the purpose of the integrated Preview panel.
Dev-only login bypass route Requires code changes to the application under development; doesn't test the actual auth flow; not always feasible with third-party SDKs.
Open OAuth URL in external browser Fragile; callback URL may not route back correctly; breaks the seamless Preview workflow.

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

  1. I'm working on a SaaS app that uses OAuth login as a core flow (like login with Google)
  2. I open settings and add the Google OAuth URLs to the Preview URL whitelist
  3. I login to my application within App Preview window without external URL errors

Additional Context

No response

edumansky avatar Feb 20 '26 22:02 edumansky

Second this, somebody please add. crazy that this wasn't thought of when releasing CC

newt-beach avatar Mar 02 '26 17:03 newt-beach

Agree, Preview does not work for any logged in pages.

marcosberghahn avatar Mar 15 '26 18:03 marcosberghahn

Please add this.

jebaprinceswiftant avatar Mar 17 '26 16:03 jebaprinceswiftant

This would be so helpful, especially for our less technical folks!

travishaby avatar Mar 17 '26 21:03 travishaby

Maybe if we copywrote our issue and put it in an ebook, Anthropic would finally read it 😆

newt-beach avatar Mar 17 '26 21:03 newt-beach

Please guys!! We need this!!!

epurban avatar Mar 18 '26 17:03 epurban

We need this, I could not test my nextjs app locally just because its configured with Clerk auth:

"Link to ***.clerk.accounts.dev was blocked. Preview only supports localhost URLs." :(

mohsiniscoding avatar Mar 19 '26 03:03 mohsiniscoding

Guys......come on

SamWhillance avatar Mar 20 '26 12:03 SamWhillance

Also what is not possbile currently... is testing app that has subdomains combined with localhost.

e.g. http://subdomain.localhost:3000/ is not an accepted url by Claude Code Preview

pbechliv avatar Mar 21 '26 11:03 pbechliv

Yeah otherwise unusable, even a different port isn't accepted, keycloak running on different port doesn't fix it for me, because it's a different origin technically but it's local, maybe we can whitelist our origins?

umutzd avatar Mar 23 '26 00:03 umutzd

Adding another use case: *.localhost subdomains for local reverse proxy routing.

We use Caddy as a local reverse proxy with subdomains routing to different services (Rails on /app/*, Zola static site on /*, Pipecat on ai.*.localhost). Preview blocks navigation to these subdomains even though they resolve to 127.0.0.1.

This isn't just an OAuth issue -- it affects any project using subdomain-based local routing (common with Caddy, Traefik, nginx-proxy). A preview.allowedDomains setting with glob support (*.localhost) would cover both this and the OAuth cases.

kylewelsby avatar Mar 24 '26 22:03 kylewelsby

I think this is crucial - MANY web apps interact with external (owned) hosts and properties.

chrisedington avatar Mar 26 '26 08:03 chrisedington

Would be nice to have this, we need to be able to authenticate on a non localhost environment, so currently using mcp workaround but would be nice to have it integrated.

bjornmonnens avatar Mar 31 '26 10:03 bjornmonnens

Bump!

lukasz-gorski avatar Apr 02 '26 20:04 lukasz-gorski

bump

PatientPadawan avatar Apr 06 '26 01:04 PatientPadawan

bump.

TheDropZone avatar Apr 09 '26 19:04 TheDropZone

bump

denvudd avatar Apr 10 '26 11:04 denvudd

bump.

I use a third party authentication service (Work OS) and also localhost domains (via Caddy) - https://api.localhost and https://portal.localhost

nigelramsay avatar Apr 10 '26 22:04 nigelramsay

Bump. This feature would be incredibly useful.

NikolaiSmow avatar Apr 17 '26 11:04 NikolaiSmow

Pretty crazy this doesn't exist. Has anyone found a workaround?

apsquared avatar Apr 21 '26 17:04 apsquared