Repository navigation
Plainwire 0.10.0: OAuth 2.0 tokens, environment editor
- OAuth 2.0 tokens:
{{$auth.token("id")}}and{{$auth.idToken("id")}}in any URL, header or body. The configuration lives in the environment, in the JetBrains HTTP Client format:"Security": { "Auth": { "id": { "Type": "OAuth2", "Grant Type": …, "Token URL": …, "Client ID": … } } }. A token is fetched before the first request that needs it, reused while it is valid, refreshed with its refresh token 30 s before it expires, and fetched again when the refresh fails. REST Client had no OAuth support (#302). - Grant types: Client Credentials, Password, Authorization Code with optional PKCE (SHA-256 or plain; the sign-in opens in your browser and Plainwire receives the redirect on
http://127.0.0.1/localhost, a free port by default), Device Authorization (the code is shown and copied, polling honoursslow_down), Implicit, and"Type": "Mock"for a fixed token. Keys:Client Credentials(basicdefault,in body,none),Scope,Redirect URL,Custom Request Parameters/Custom Request HeaderswithUse(Everywhere,In Auth Request,In Token Request),Acquire Automatically,Use ID Token,Open Complete URI; any value can use{{variables}}. Checked live against Duende's public IdentityServer demo: Client Credentials, and Authorization Code + PKCE through a real browser login, including a refresh after the token expired. - Object values in env files now merge key by key across
http-client.env.json→http-client.private.env.jsonand$shared→ the selected environment, so the private file can hold just theClient Secret. (Before, a later object replaced the whole value.) - Request editor: the Auth tab has an OAuth 2 option (pick a configuration of the current environment, send the ID token instead, Acquire token now).
- Commands Plainwire: Acquire OAuth 2 Token… (fresh token now) and Plainwire: Clear OAuth 2 Tokens. Tokens stay in memory for the window; they are not written to disk or history. Copy as cURL / Code uses a cached token and never starts a sign-in.
- A JSON schema for
http-client.env.json/http-client.private.env.json: completions and hover text for every auth key and value. - CLI: one token per
plainwire run; browser grants print the sign-in URL (and open a browser in a terminal);-vlogs token activity. - Site: the "Cookies and session logins" guide's main content was rendered inside the page header (missing tags); fixed.
- Environment editor: Plainwire: Edit Environments… (also Edit environments… in the status-bar environment picker and in the Requests view's
…menu) opens a form overhttp-client.env.json: environments as tabs with Shared (all environments) first, and per variable a name, a value and a Secret box. Add, rename and delete variables and environments; Save orCtrl/Cmd+S, with an unsaved-changes marker. - Secret values go to
http-client.private.env.jsonin the same folder (created on first save) and are masked until you click Show. If the workspace's.gitignoredoes not cover that file, the editor says so and adds it in one click. - Nothing you do not edit is lost: values that are not strings (objects such as an OAuth
Securityblock, arrays, numbers, booleans) are shown read-only with Open JSON and written back as they were,$schemaand other keys are kept, existing keys keep their order, and a file whose content does not change is not rewritten. Files are written with 2-space indent and a trailing newline. - Several
http-client.env.jsonfiles in the workspace: pick which folder's pair to edit. With none, the files are created in the first workspace folder. If the files change on disk while the editor is open, it reloads (no unsaved edits) or offers Reload / Overwrite. The active environment is still chosen in the status bar, and it picks up saved changes straight away.
Install: download plainwire-0.10.0.vsix and run Extensions: Install from VSIX… (VS Code, Cursor, Windsurf, VSCodium). CLI: plainwire.mjs (Node 18+) or npm install -g plainwire-cli-0.10.0.tgz. Guide: https://janwan2003.github.io/vscode-api-client/oauth2-http-file-vscode.html