#7651 wrangler login does not work with VPNs (Tailscale and such)
PR #8316 (Apr 2025) added --callback-host/--callback-port params and PR #9396 (Jan 2026) fixed OAuth redirect_uri handling. These provide workarounds for VPN scenarios but user's "paste code" request not implemented.
Ask reporter to verify if --callback-host option resolves VPN issues on latest wrangler
Analysis Report
Issue Review: cloudflare/workers-sdk#7651
Summary
wrangler login fails with VPNs due to localhost callback being unreachable, but workarounds now exist.
Findings
- Created: 2024-12-31
- Updated: 2025-10-30
- Version: 3.95.0 → 4.60.0 (current)
- Component: wrangler (login/OAuth)
- Labels: bug
- Comments: 2
Key Evidence
Issue Description: User reports
wrangler loginfails when using VPNs (Tailscale, etc.) because the localhost OAuth callback cannot be reached. The user requests the ability to paste an auth code directly instead of relying on localhost callback.Related Fixes Found:
- PR #8316 (merged 2025-04-16): Introduced
--callback-hostand--callback-portparameters forwrangler login, allowing users to specify a custom host/port for the OAuth callback server (e.g.,0.0.0.0for containers/VPN scenarios). - PR #9396 (merged 2026-01-20): Fixed an issue where custom
--callback-host/--callback-portvalues were incorrectly passed to the OAuth API. Theredirect_uriis now alwayslocalhost:8976as required by Cloudflare's OAuth API, but users can configure the Wrangler server to listen on different host/port and use port forwarding.
- PR #8316 (merged 2025-04-16): Introduced
Changelog Confirmation: Both fixes are documented in the wrangler CHANGELOG.md:
- PR #8316: "introduce callback-host and callback-port param for wrangler login command"
- PR #9396: "Fix
wrangler loginwith customcallback-host/callback-port"
User's Specific Request: The user asked for the ability to paste an auth code directly (
--browser=falsewith code input). While this specific feature was NOT implemented, the--callback-hostand--callback-portoptions provide a workaround for VPN/container scenarios.Reproduction Confirmed: Comment from 2025-10-22 confirms the issue still affects users with VPNs (macOS with Outline VPN).
Recommendation
Status: NEEDS VERIFICATION
Reasoning: Significant improvements have been made to wrangler login with the --callback-host and --callback-port parameters (PR #8316 and PR #9396). These options allow users behind VPNs to configure the OAuth callback server to listen on a different interface (e.g., 0.0.0.0 or 127.0.0.1). However, the user's original request for a "paste code" flow was not implemented. The workarounds should help most VPN scenarios, but verification with the reporter is needed.
Action: Ask the reporter to verify if the new --callback-host option resolves their issue with VPNs.
Suggested Comment
Hi @Peru-S, since this issue was reported, Wrangler has added
--callback-hostand--callback-portoptions to thewrangler logincommand (PR #8316, PR #9396).For VPN scenarios, you can try:
npx wrangler login --callback-host=127.0.0.1 # or npx wrangler login --callback-host=0.0.0.0This allows the OAuth callback server to listen on a specific interface that may work better with your VPN configuration.
Could you please test with the latest version of Wrangler (currently 4.60.0) and these options to see if this resolves your issue? If the problem persists, please share additional details about your VPN setup. Thanks!
Notes & Feedback (0)
No notes yet.