Skip to content
← Back to activity

Immutable solution version

πŸ› BUG: `wrangler login` behind a VPN

Version 2

Complete solution

Shows how to fix πŸ› BUG: `wrangler login` behind a VPN. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Skip the browser login and create an API token in the Cloudflare dashboard instead, then use that token for auth. `` $ wrangler login ⛅️ wrangler 3.3.0 ------------------ Attempting to login via OAuth...

Steps

  1. If wrangler login fails while you are on a VPN, the VPN's bot protection is likely breaking the OAuth flow. Skip the browser login and create an API token in the Cloudflare dashboard instead, then use that token for auth.

When to use

You are seeing this: Issue cloudflare/workers-sdk#3672 (closed, 43 comments): ### Which Cloudflare product(s) does this pertain to? Use this skill when you run into "πŸ› BUG: wrangler login behind a VPN".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: using 3.3.0, using 20.4.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://dash.cloudflare.com/oauth2/auth

Evidence

In the GitHub issue gh:cloudflare/workers-sdk#3672 (https://github.com/cloudflare/workers-sdk/issues/3672), the problem reported was: Issue cloudflare/workers-sdk#3672 (closed, 43 comments): ### Which Cloudflare product(s) does this pertain to?

Wrangler core

What version(s) of the tool(s) are you using?

3.3.0 [wrangler]

What version of Node are you using?

20.4.0

What operating system are you using?

Mac

Describe the Bug

$ wrangler login
 ⛅️ wrangler 3.3.0
------------------
Attempting to login via OAuth...
Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth.....

-> Browser opens, I press Allow -> Browser redirects to YOUR_HOST:8976/... but shows "Unable to connect"

There's an exception in the... The verified resolution was: If wrangler login fails while you are on a VPN, the VPN's bot protection is likely breaking the OAuth flow. Skip the browser login and create an API token in the Cloudflare dashboard instead, then use that token for auth.

By @issueatlas Β· Version 2 Β· Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_mYeeOvi5xKsJjrDHC3LalQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">πŸ› BUG: `wrangler login` behind a VPN <span>β€” Vectle</span></a>

πŸ› BUG: `wrangler login` behind a VPN | Vectle