Packages

@cloudflare/workers-auth

0.18.6 · 20 Nov 2026MIT OR Apache-2.0565.1k / weekRepositoryHomepagenpmAtom feed

Your version

65 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 0.5.x
  2. 0.5.5

    31 Jul 2026

    Only updates a dependency:@cloudflare/workers-utils 0.31.0

  3. 0.5.4

    30 Jul 2026
    • 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. cloudflared is 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-pending cloudflared immediately, with process exit as a last-resort cleanup.

  4. 0.5.3

    28 Jul 2026

    Only updates a dependency:@cloudflare/workers-utils 0.29.0

  5. 0.5.2

    23 Jul 2026
    • Make auth profile guidance CLI agnostic

      Remove Wrangler-specific wording from shared profile errors and add cf auth create to cf's auth descriptor.

  6. 0.5.1

    21 Jul 2026

    Only updates a dependency:@cloudflare/workers-utils 0.28.0

  7. 0.5.0

    15 Jul 2026
    • Extract the Cloudflare CLI auth layer into a product-agnostic @cloudflare/workers-auth core

      The OAuth login/logout/refresh, credential storage, config cache, and account-selection machinery is now shared behind an AuthProduct descriptor, 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 the cf CLI: 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 so cf login/logout never purges wrangler's cache.

      As part of the extraction, @cloudflare/workers-utils now exports the shared createConfigCache (with a namespace option), openInBrowser, and the isInteractive / isNonInteractiveOrCI / isCI TTY-and-CI detection helpers (each taking the caller's logger as a parameter rather than relying on a singleton). These read a bundled ci-info, so consumers that need to fake CI in their tests should mock this package's helpers rather than ci-info directly.

  8. 0.4.x
  9. 0.4.1 – 0.4.22 releases that only update dependencies@cloudflare/workers-utils 0.26.0Show each
  10. 0.4.0

    2 Jul 2026
    • Add opt-in OS keychain storage for OAuth credentials

      By default wrangler stores 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-keyring writes 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 security tool (nothing to install); Linux uses secret-tool from libsecret-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_TOKEN and CLOUDFLARE_API_KEY/CLOUDFLARE_EMAIL continue to take priority over any stored OAuth credentials.

  11. 0.3.x
  12. 0.3.1 – 0.3.22 releases that only update dependencies@cloudflare/workers-utils 0.24.0undici 7.28.0Show each
  13. 0.3.0

    16 Jun 2026
    • Add a --temporary flag 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 for yes; 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.

  14. 0.2.x
  15. 0.2.0

    11 Jun 2026
    • Make the OAuth identity and token storage injectable, and add a shared env-credential resolver

      createOAuthFlow now takes the consumer's OAuth identity (clientId, consent, redirectUri) and token storage on 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 --remote or 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 a wrangler whoami tip.

      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.

  16. 0.1.x
  17. 0.1.1

    4 Jun 2026
    • Extract the OAuth 2.0 + PKCE flow into a new @cloudflare/workers-auth package.

      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-auth package. 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-auth is published with prerelease: true and is not intended for external use — its APIs may change without notice.

    • Tighten on-disk permissions of the OAuth credentials file to 0600

      The user auth config file written by wrangler login (typically ~/.config/.wrangler/config/default.toml on Linux/macOS, or <environment>.toml for non-production Cloudflare API environments) is now written with mode 0600 and 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 login is rejected by the OAuth provider (for example with invalid_scope).

      Previously, if the OAuth callback returned with an error other than access_denied, Wrangler would never respond to the browser. Because server.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 bare error code. 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.

  18. 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.