Skip to content
← All articles

• 6 min read

Argy Code on WSL and Linux: signing in when the credential vault is unavailable

On WSL or a Linux server without a desktop session, signing in to Argy Code can fail on the credential vault. Here is why, how to get unblocked in a few minutes with a personal access token, and what to know if your account spans several organizations.

  • Argy Code
  • Security
  • WSL
  • Authentication

You run argy auth login, the browser opens, you confirm the device code, the terminal prints "Authorized"… and then an error about the "system credential vault". On WSL or a Linux server without a desktop, sign-in did succeed: it is local storage that has nowhere to put its key.

For an account attached to a single organization, the workaround is simple, safe, and takes a few minutes. If your account spans several organizations, also read the dedicated section further down.

What you see

◇  Authorized
Error: Access to the system credential vault is denied, […]

The message is deliberately generic: it covers several situations, including a vault entry changed by another Argy Code build. On WSL, the cause is almost always simpler: no vault is available.

Why it happens

Argy Code never leaves your credentials in clear text on disk. They are encrypted, and the encryption key is entrusted to your machine's native vault:

  • on Windows, Credential Manager;
  • on macOS, Keychain;
  • on Linux, a "Secret Service" (for example gnome-keyring), reached over D-Bus.

A WSL distribution, a container or a minimal Linux server usually ships neither a D-Bus session nor a keyring. Argy Code therefore has no safe place to create or read the key, and it stops rather than store a secret in a degraded way. This is a deliberate security choice: no silent fallback to an unprotected file.

To confirm you are in this situation:

echo "$DBUS_SESSION_BUS_ADDRESS"
which gnome-keyring-daemon secret-tool

If the first command prints nothing and the second finds no binary, no Secret Service was detected by these commands: you are very likely in this situation.

Argy Code can authenticate with a personal access token (PAT) provided by the environment. In this mode it does not need the vault to read your credentials, which is enough for an account attached to a single organization. The multi-organization case is covered further down.

1. Create a PAT from the Argy portal. Pick a validity period that fits your needs: a token can be revoked at any time. Keep the standard signed format: the portal may preselect the short pat_v2_ format, but Argy Code cannot read the metadata of a token in that format (organization, identity). Do not keep it for this use.

2. Store it in a file only you can read and modify, through masked input that keeps the token out of your shell history (paste the PAT when "PAT: " appears, then press Enter):

( umask 077; mkdir -p ~/.config; read -rsp 'PAT: ' p && printf '%s' "$p" > ~/.config/argy-pat )
echo

The subshell limits umask 077 to this command, and the second echo simply moves the cursor to a new line.

3. Point Argy Code at that file, in your ~/.bashrc (or ~/.zshrc):

export ARGY_PAT_FILE="$HOME/.config/argy-pat"

4. Reload your shell and start Argy Code:

source ~/.bashrc
argy

For a single-organization account, the token is read at every launch: you can work without going through argy auth login, whose credential write would fail anyway without a vault.

Why a file rather than a variable?

ARGY_PAT works too, but the token then ends up in your shell history and in the environment of every process started from the terminal. With ARGY_PAT_FILE, only the file path is exposed, and the file, readable and modifiable by you alone (permissions 600 through umask 077), stays the only place the secret exists.

A few simple rules:

  • never commit this file, and never place it inside a repository;
  • never paste the token in a ticket, a chat or a log;
  • if you exposed it by mistake, revoke it from the portal and create a new one.

If your account spans several organizations

The PAT solves reading your credentials, not yet choosing the organization. When your account is attached to several organizations, the interactive Argy Code interface asks you to pick one, and this window cannot be closed without a choice. Confirming the choice means saving it in the vault: without a vault, the save fails, an "organization switch failed" message appears and the selection window comes back.

The ARGY_ORG_ID variable does select the organization without going through the vault, but it does not stop this window from opening in the interactive interface: it does not unblock you. Running argy auth login again does not help either, since writing the credentials also fails without a vault.

Two routes remain open:

  • run your requests outside the interactive interface, specifying the organization on each call (to be validated in your environment):
argy run --org <organization-id> "…"
  • or use Argy Code on the Windows side, from PowerShell, where the vault is native (see below).

Organization selection without a vault is the subject of a product evolution.

Two alternatives

Use Argy Code on the Windows side. If you are on WSL only because your projects live there, start Argy Code from PowerShell: Credential Manager works natively. Your projects remain reachable from Windows if they are stored under C:\ (visible in WSL under /mnt/c); a project stored in the WSL Linux file system can also be opened from Windows, but more slowly.

Install a Secret Service inside WSL. An advanced option whose setup depends on the distribution and the machine: it requires a D-Bus session and a keyring unlocked at every new WSL session. It is a less suitable first choice than the routes above. If you go with it, pick a real password for the keyring (an empty password weakens its protection):

sudo apt install -y gnome-keyring libsecret-1-0 dbus-user-session
dbus-run-session -- bash
# then, in the shell opened by dbus-run-session:
read -rsp 'Keyring password: ' p && echo
printf '%s' "$p" | gnome-keyring-daemon --unlock --components=secrets
unset p
argy auth login

dbus-run-session opens a shell attached to its own D-Bus session: start Argy Code from that shell. Apart from the installation, this sequence has to be repeated at every new session.

What about NODE_TLS_REJECT_UNAUTHORIZED=0?

Turning off TLS verification with NODE_TLS_REJECT_UNAUTHORIZED=0 is not a solution: it removes certificate verification for every connection of the process, and it is unrelated to the vault error. Behind a proxy that intercepts TLS, provide the company root certificate instead:

export NODE_EXTRA_CA_CERTS=/path/to/company-ca.pem

You keep TLS verification, and the connection goes through the proxy as intended.

In short

On WSL, the vault error almost always signals a missing Secret Service, not a failed sign-in. For a single-organization account, a PAT stored in a file reserved to you and declared with ARGY_PAT_FILE gets you back to work in a few minutes. If your account spans several organizations, go through argy run --org or Argy Code on the Windows side until the product evolution is available. And whatever your case, keep TLS verification on: add your company certificate instead.

Still stuck after these steps? Send us the full error message, never including your token, to identify the right route for your machine.