Skip to content

[wrangler] Document wrangler login --experimental-device#31091

Draft
petebacondarwin wants to merge 2 commits into
productionfrom
pbacondarwin/wrangler-login-experimental-device-flow
Draft

[wrangler] Document wrangler login --experimental-device#31091
petebacondarwin wants to merge 2 commits into
productionfrom
pbacondarwin/wrangler-login-experimental-device-flow

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

Summary

Documents the new experimental wrangler login --experimental-device flag, which adds support for the OAuth 2.0 Device Authorization Grant to Wrangler.

This flow is useful in environments where the default localhost callback flow is impractical:

  • containers without forwarded ports,
  • remote SSH sessions,
  • GitHub Codespaces and other web-based IDEs,
  • restricted networks where localhost:8976 is unreachable from the browser.

It does not start a local callback server. Instead, Wrangler prints a verification URL and short user code, opens the URL in the user's default browser, prints a QR code of the URL, and polls Cloudflare for an access token until the user approves.

Companion to cloudflare/workers-sdk#14064.

This is a draft PR — the underlying wrangler PR is also draft and depends on server-side rollout of OAuth Device Authorization Grant in Hydra (tracked in AUTHN-168 and AUTHN-173). I'll un-draft this once the wrangler-side PR is ready to release.

Documentation checklist

  • Is there a changelog entry?
    • Will add a changelog entry once we're ready to release. The wrangler PR is gated on server-side dependencies.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes. (Not a new page — extends an existing one.)
  • Files which have changed name or location have been allocated redirects. (No renames.)

Adds documentation for the new `--experimental-device` flag on
`wrangler login`, which uses the OAuth 2.0 Device Authorization Grant
(RFC 8628) instead of the default localhost callback flow.

Useful in containers, remote SSH sessions, GitHub Codespaces, and any
other environment where `localhost:8976` is unreachable from the user's
browser.

Companion to cloudflare/workers-sdk#14064
@github-actions github-actions Bot added product:workers Related to Workers product size/s labels May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/workers/wrangler/ @cloudflare/wrangler, @irvinebroque, @cloudflare/product-owners, @MattieTK

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 2 style guide violations need fixing. Otherwise the PR is accurate and well-structured.

Issues:

  • MEDIUM src/content/docs/workers/wrangler/commands/general.mdx:50 — Directional language ("below") violates the style guide. Posted an inline suggestion.
  • MEDIUM src/content/docs/workers/wrangler/commands/general.mdx:123 — Directional language ("previous sections") violates the style guide. Posted an inline suggestion.

Summary: Documents the new --experimental-device flag for wrangler login, which enables the OAuth 2.0 Device Authorization Grant for environments where the localhost callback is unreachable. Adds the flag to the options list and a new subsection explaining the flow, QR code output, and interaction with --browser=false. Added product:workers and documentation labels.

- Defaults to `8976`. Sets the port where Wrangler should listen for the OAuth callback.
- Defaults to `8976`. Sets the port where Wrangler should listen for the OAuth callback. Ignored when `--experimental-device` is set.
- `--experimental-device` <Type text="boolean" /> <MetaInfo text="optional" />
- Defaults to `false`. Use the OAuth 2.0 Device Authorization Grant ([RFC 8628](https://www.rfc-editor.org/rfc/rfc8628)) instead of the default localhost callback flow. See [Use `wrangler login` without a local callback server](#use-wrangler-login-without-a-local-callback-server) below.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace directional language per style guide:

Suggested change
- Defaults to `false`. Use the OAuth 2.0 Device Authorization Grant ([RFC 8628](https://www.rfc-editor.org/rfc/rfc8628)) instead of the default localhost callback flow. See [Use `wrangler login` without a local callback server](#use-wrangler-login-without-a-local-callback-server) below.
- Defaults to `false`. Use the OAuth 2.0 Device Authorization Grant ([RFC 8628](https://www.rfc-editor.org/rfc/rfc8628)) instead of the default localhost callback flow. Refer to [Use `wrangler login` without a local callback server](#use-wrangler-login-without-a-local-callback-server).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 7bce811 — thanks.

The `--experimental-device` flag is experimental. The flag name, output, and exact behavior may change in future releases.
:::

The default `wrangler login` flow needs your browser to be able to reach a temporary local server on `localhost:8976`. In some environments — remote SSH sessions, containers without forwarded ports, GitHub Codespaces, or otherwise restricted networks — that callback URL is unreachable from the browser, and the workarounds in the previous sections may be difficult to set up.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid directional language ("previous sections"). Reference by topic instead:

Suggested change
The default `wrangler login` flow needs your browser to be able to reach a temporary local server on `localhost:8976`. In some environments — remote SSH sessions, containers without forwarded ports, GitHub Codespaces, or otherwise restricted networks — that callback URL is unreachable from the browser, and the workarounds in the previous sections may be difficult to set up.
The default `wrangler login` flow needs your browser to be able to reach a temporary local server on `localhost:8976`. In some environments — remote SSH sessions, containers without forwarded ports, GitHub Codespaces, or otherwise restricted networks — that callback URL is unreachable from the browser, and setting up the workarounds for remote machines and containers may be difficult.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 7bce811 — thanks.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 27, 2026

Verdict: Posted 2 inline suggestions. Otherwise the PR is accurate and well-structured.

Issues:

  • MEDIUM src/content/docs/workers/wrangler/commands/general.mdx:50 — Directional language ("below") violates the style guide. Suggested replacing "See ... below" with "Refer to ...".
  • MEDIUM src/content/docs/workers/wrangler/commands/general.mdx:123 — Directional language ("previous sections") violates the style guide. Suggested rewording to reference the topic directly.

Labels applied: product:workers, documentation

What the PR changes: Documents the new --experimental-device flag for wrangler login, which enables the OAuth 2.0 Device Authorization Grant for environments where the localhost callback is unreachable (containers, SSH sessions, Codespaces, restricted networks). Adds the flag to the options list, notes that --callback-host and --callback-port are ignored when it is set, and adds a new subsection explaining the flow, terminal output, QR code, and the --browser=false interaction.

github run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Replaces directional language ("below", "previous sections") with
topic-referenced wording per the Cloudflare docs style guide.

- Line 50: 'See ... below' \u2192 'Refer to ...'
- Line 123: 'workarounds in the previous sections' \u2192 'workarounds for
  remote machines and containers'

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

Labels

documentation Documentation edits product:workers Related to Workers product size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants