@cloudflare/workers-auth
0.18.6 · 20 Nov 2026MIT OR Apache-2.0565.1k / weekRepositoryHomepagenpmAtom feed
65 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.5.x
0.5.5
31 Jul 2026Only updates a dependency:@cloudflare/workers-utils 0.31.0
0.5.4
30 Jul 2026Fix ctrl+c not being able to interrupt wrangler while waiting for Cloudflare Access authorization
When a domain is behind Cloudflare Access (for example during remote bindings startup), wrangler runs
cloudflared access login, which only returns once the user completes the authorization flow in the browser. This was invoked synchronously, blocking Node's event loop, so wrangler could not react to ctrl+c (or anything else) until the authorization completed — abandoning the browser flow left a hung wrangler process that had to be killed externally.cloudflaredis now spawned asynchronously, keeping wrangler responsive while it waits. The remote runtime passes its abort signal through to the spawn, so tearing down the session kills a still-pendingcloudflaredimmediately, with process exit as a last-resort cleanup.
Patch Changes
Fix ctrl+c not being able to interrupt wrangler while waiting for Cloudflare Access authorization
When a domain is behind Cloudflare Access (for example during remote bindings startup), wrangler runs
cloudflared access login, which only returns once the user completes the authorization flow in the browser. This was invoked synchronously, blocking Node's event loop, so wrangler could not react to ctrl+c (or anything else) until the authorization completed — abandoning the browser flow left a hung wrangler process that had to be killed externally.cloudflaredis now spawned asynchronously, keeping wrangler responsive while it waits. The remote runtime passes its abort signal through to the spawn, so tearing down the session kills a still-pendingcloudflaredimmediately, with process exit as a last-resort cleanup.
0.5.3
28 Jul 2026Only updates a dependency:@cloudflare/workers-utils 0.29.0
0.5.2
23 Jul 2026Make auth profile guidance CLI agnostic
Remove Wrangler-specific wording from shared profile errors and add
cf auth createto cf's auth descriptor.
0.5.1
21 Jul 2026Only updates a dependency:@cloudflare/workers-utils 0.28.0
0.5.0
15 Jul 2026Extract the Cloudflare CLI auth layer into a product-agnostic
@cloudflare/workers-authcoreThe OAuth login/logout/refresh, credential storage, config cache, and account-selection machinery is now shared behind an
AuthProductdescriptor, with a thin per-CLI entrypoint on top.@cloudflare/workers-auth/wrangler(createWranglerAuth) preserves wrangler's existing behaviour, and a new@cloudflare/workers-auth/cf(createCfAuth) adds thecfCLI: its own OAuth app registration (client id, callback port, branded consent pages, scoped-token-only auth), a dedicated scope catalog, JSON config files under~/.config/cloudflare, and an isolated config-cache namespace socflogin/logout never purges wrangler's cache.As part of the extraction,
@cloudflare/workers-utilsnow exports the sharedcreateConfigCache(with anamespaceoption),openInBrowser, and theisInteractive/isNonInteractiveOrCI/isCITTY-and-CI detection helpers (each taking the caller's logger as a parameter rather than relying on a singleton). These read a bundledci-info, so consumers that need to fake CI in their tests should mock this package's helpers rather thanci-infodirectly.
Minor Changes
Extract the Cloudflare CLI auth layer into a product-agnostic
@cloudflare/workers-authcoreThe OAuth login/logout/refresh, credential storage, config cache, and account-selection machinery is now shared behind an
AuthProductdescriptor, with a thin per-CLI entrypoint on top.@cloudflare/workers-auth/wrangler(createWranglerAuth) preserves wrangler's existing behaviour, and a new@cloudflare/workers-auth/cf(createCfAuth) adds thecfCLI: its own OAuth app registration (client id, callback port, branded consent pages, scoped-token-only auth), a dedicated scope catalog, JSON config files under~/.config/cloudflare, and an isolated config-cache namespace socflogin/logout never purges wrangler's cache.As part of the extraction,
@cloudflare/workers-utilsnow exports the sharedcreateConfigCache(with anamespaceoption),openInBrowser, and theisInteractive/isNonInteractiveOrCI/isCITTY-and-CI detection helpers (each taking the caller's logger as a parameter rather than relying on a singleton). These read a bundledci-info, so consumers that need to fake CI in their tests should mock this package's helpers rather thanci-infodirectly.
- 0.4.x
0.4.1 – 0.4.22 releases that only update dependencies@cloudflare/workers-utils 0.26.0Show each
- 0.4.29 Jul 2026@cloudflare/workers-utils 0.26.0
- 0.4.17 Jul 2026@cloudflare/workers-utils 0.25.1
0.4.0
2 Jul 2026Add opt-in OS keychain storage for OAuth credentials
By default
wranglerstores your OAuth tokens in a plaintext file, and that is unchanged. You can now opt in to encrypting them at rest instead:wrangler login --use-keyringwrites the tokens to an AES-256-GCM-encrypted file whose key is held in your OS keyring (macOS Keychain, libsecret on Linux, or Windows Credential Manager). Existing plaintext credentials are migrated automatically on first use.Toggle it with any of:
Opting out deletes the encrypted credentials rather than decrypting them back to disk, so you re-authenticate afterwards. The preference applies to every auth profile, and each named profile gets its own encrypted file and key.
Per-platform requirements: macOS uses the built-in
securitytool (nothing to install); Linux usessecret-toolfromlibsecret-tools(wrangler prints an install hint if it is missing); Windows lazily installs@napi-rs/keyring(~1.9 MB) on first opt-in, and errors with instructions in non-interactive/CI contexts.CLOUDFLARE_API_TOKENandCLOUDFLARE_API_KEY/CLOUDFLARE_EMAILcontinue to take priority over any stored OAuth credentials.
Minor Changes
Add opt-in OS keychain storage for OAuth credentials
By default
wranglerstores your OAuth tokens in a plaintext file, and that is unchanged. You can now opt in to encrypting them at rest instead:wrangler login --use-keyringwrites the tokens to an AES-256-GCM-encrypted file whose key is held in your OS keyring (macOS Keychain, libsecret on Linux, or Windows Credential Manager). Existing plaintext credentials are migrated automatically on first use.Toggle it with any of:
wrangler login --use-keyring/--no-use-keyringwrangler auth keyring enable/disable(orwrangler auth keyringto print the current setting) — useful if you only use named profiles and never run the globalwrangler loginCLOUDFLARE_AUTH_USE_KEYRING=true|falseto override the saved preference for a single command
Opting out deletes the encrypted credentials rather than decrypting them back to disk, so you re-authenticate afterwards. The preference applies to every auth profile, and each named profile gets its own encrypted file and key.
Per-platform requirements: macOS uses the built-in
securitytool (nothing to install); Linux usessecret-toolfromlibsecret-tools(wrangler prints an install hint if it is missing); Windows lazily installs@napi-rs/keyring(~1.9 MB) on first opt-in, and errors with instructions in non-interactive/CI contexts.CLOUDFLARE_API_TOKENandCLOUDFLARE_API_KEY/CLOUDFLARE_EMAILcontinue to take priority over any stored OAuth credentials.
- 0.3.x
0.3.1 – 0.3.22 releases that only update dependencies@cloudflare/workers-utils 0.24.0undici 7.28.0Show each
- 0.3.219 Jun 2026@cloudflare/workers-utils 0.24.0
- 0.3.118 Jun 2026@cloudflare/workers-utils 0.23.2undici 7.28.0
0.3.0
16 Jun 2026Add a
--temporaryflag that creates and uses a temporary Cloudflare preview account when you have no credentials, instead of starting the OAuth login flow.It's registered only on the commands the short-lived account token can serve — Workers (
deploy,versions upload, and related commands), KV, D1, Hyperdrive, Queues, and certificate commands — and is for unauthenticated use only: passing it while already authenticated (OAuth,CLOUDFLARE_API_TOKEN, or a global API key) errors rather than silently ignoring the flag. Before provisioning, Wrangler handles Cloudflare's Terms of Service and Privacy Policy (interactive terminals prompt foryes; non-interactive shells print a notice and continue). Wrangler then runs with the short-lived token and prints a claim URL so the account can be claimed before it expires. The cached account is cleared on successful login or logout.
Minor Changes
Add a
--temporaryflag that creates and uses a temporary Cloudflare preview account when you have no credentials, instead of starting the OAuth login flow.It's registered only on the commands the short-lived account token can serve — Workers (
deploy,versions upload, and related commands), KV, D1, Hyperdrive, Queues, and certificate commands — and is for unauthenticated use only: passing it while already authenticated (OAuth,CLOUDFLARE_API_TOKEN, or a global API key) errors rather than silently ignoring the flag. Before provisioning, Wrangler handles Cloudflare's Terms of Service and Privacy Policy (interactive terminals prompt foryes; non-interactive shells print a notice and continue). Wrangler then runs with the short-lived token and prints a claim URL so the account can be claimed before it expires. The cached account is cleared on successful login or logout.
- 0.2.x
0.2.0
11 Jun 2026Make the OAuth identity and token storage injectable, and add a shared env-credential resolver
createOAuthFlownow takes the consumer's OAuth identity (clientId,consent,redirectUri) and tokenstorageon its context, so other Cloudflare CLIs can reuse the flow under their own OAuth app and store tokens in their own location/format. Also adds a shared env→credential resolver (getAuthFromEnv,getAPIToken,requireApiToken).Improve authentication error messages with specific failure reasons
When authentication fails (e.g. during
wrangler dev --remoteor when using remote bindings), the error message now explains exactly what went wrong -- whether no credentials were found, the token expired, or the environment is non-interactive -- and lists actionable steps to fix it, including awrangler whoamitip.Previously, auth failures could produce multiple confusing errors (e.g. "Failed to fetch auth token: 400 Bad Request" followed by "Failed to start the remote proxy session"). Now a single, clear error is shown.
- 0.1.x
0.1.1
4 Jun 2026Extract the OAuth 2.0 + PKCE flow into a new
@cloudflare/workers-authpackage.The OAuth login / logout / refresh logic, the auth-config TOML file IO, the OAuth token exchange + local callback server, and the Cloudflare Access detection helpers that previously lived in
packages/wrangler/src/user/have moved to the new internal-only@cloudflare/workers-authpackage. Wrangler now wires the OAuth flow up via a small glue module that injects its logger, browser opener, interactivity detector, and config cache via a dependency- injection context.What stays in wrangler:
No behavior change for end users. The on-disk TOML format and location remain identical, and all telemetry message labels are preserved verbatim.
@cloudflare/workers-authis published withprerelease: trueand is not intended for external use — its APIs may change without notice.Tighten on-disk permissions of the OAuth credentials file to
0600The user auth config file written by
wrangler login(typically~/.config/.wrangler/config/default.tomlon Linux/macOS, or<environment>.tomlfor non-production Cloudflare API environments) is now written with mode0600and re-chmod-ed on every save. This prevents other local users on shared hosts from reading the stored OAuth tokens. Existing files with looser permissions written by older Wrangler versions are tightened the next time Wrangler refreshes the token or the user logs in again. The change is a no-op on Windows, which does not honour POSIX mode bits.Show the actual OAuth error instead of hanging when
wrangler loginis rejected by the OAuth provider (for example withinvalid_scope).Previously, if the OAuth callback returned with an
errorother thanaccess_denied, Wrangler would never respond to the browser. Becauseserver.close()'s callback only fires once all open connections have ended, the login command would hang until the 120 second OAuth timeout — at which point it would print a generic timeout message rather than the actual OAuth failure. The same gap existed for the case where the OAuth provider redirected back without an authorisation code, and for failures during the auth-code-to-access-token exchange.The OAuth provider's
error_description(RFC 6749 §4.1.2.1) is now also surfaced, so the message includes the specific reason for the failure rather than just the bareerrorcode. For example, a misconfigured staging scope now surfaces as:OAuth error: invalid_scope The OAuth 2.0 Client is not allowed to request scope 'browser:write'.
instead of hanging silently.
Patch Changes
Extract the OAuth 2.0 + PKCE flow into a new
@cloudflare/workers-authpackage.The OAuth login / logout / refresh logic, the auth-config TOML file IO, the OAuth token exchange + local callback server, and the Cloudflare Access detection helpers that previously lived in
packages/wrangler/src/user/have moved to the new internal-only@cloudflare/workers-authpackage. Wrangler now wires the OAuth flow up via a small glue module that injects its logger, browser opener, interactivity detector, and config cache via a dependency- injection context.What stays in wrangler:
The yargs
login/logout/whoami/auth tokencommandsEnvironment-based credential resolution (
CLOUDFLARE_API_TOKEN,CLOUDFLARE_API_KEY/CLOUDFLARE_EMAIL, etc.)Cloudflare account selection (
requireAuth,getOrSelectAccountId)The OAuth scope catalog (passed into the OAuth flow as a generic
string)whoami/ account fetching
No behavior change for end users. The on-disk TOML format and location remain identical, and all telemetry message labels are preserved verbatim.
@cloudflare/workers-authis published withprerelease: trueand is not intended for external use — its APIs may change without notice.Tighten on-disk permissions of the OAuth credentials file to
0600The user auth config file written by
wrangler login(typically~/.config/.wrangler/config/default.tomlon Linux/macOS, or<environment>.tomlfor non-production Cloudflare API environments) is now written with mode0600and re-chmod-ed on every save. This prevents other local users on shared hosts from reading the stored OAuth tokens. Existing files with looser permissions written by older Wrangler versions are tightened the next time Wrangler refreshes the token or the user logs in again. The change is a no-op on Windows, which does not honour POSIX mode bits.Show the actual OAuth error instead of hanging when
wrangler loginis rejected by the OAuth provider (for example withinvalid_scope).Previously, if the OAuth callback returned with an
errorother thanaccess_denied, Wrangler would never respond to the browser. Becauseserver.close()'s callback only fires once all open connections have ended, the login command would hang until the 120 second OAuth timeout — at which point it would print a generic timeout message rather than the actual OAuth failure. The same gap existed for the case where the OAuth provider redirected back without an authorisation code, and for failures during the auth-code-to-access-token exchange.The OAuth provider's
error_description(RFC 6749 §4.1.2.1) is now also surfaced, so the message includes the specific reason for the failure rather than just the bareerrorcode. For example, a misconfigured staging scope now surfaces as:OAuth error: invalid_scope The OAuth 2.0 Client is not allowed to request scope 'browser:write'.
instead of hanging silently.
0.1.0
2 Jun 2026
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.