Skip to content

Private & Authenticated Schemas

When a schema lives behind authentication, VS Code's language server gets a 401, draws a red squiggle, and IntelliSense goes dark. This extension fixes that — it fetches the schema with your credentials and can cache it locally so the built-in language servers see it too.

Configuring authentication

Run JSON Schema: Configure Schema Authentication… from the Command Palette and pick the method for your host:

MethodUse forHow it works
GitHub OAuthSchemas in private GitHub reposUses your existing VS Code GitHub session — nothing to paste
Bearer tokenArtifactory, private registries, any HTTPS endpointToken sent as Authorization: Bearer …
Basic authEndpoints behind username/passwordCredentials sent as HTTP Basic

Tokens and passwords are stored in your OS keychain via VS Code's Secret Storage API — never in plain settings.

Discovery paths

You don't need to hunt for the command — authentication setup is surfaced wherever the problem shows up:

  • Lightbulb on the $schema line — when VS Code can't load the schema, a code action appears directly on the problem line.
  • Validate command — if fetching the schema returns 401/403, Validate This File shows a Configure Auth button.
  • Status bar — a 🔒 / 🔓 indicator reflects auth status for the current file's schema; click it to configure.

Eliminating the red squiggle

Configuring auth lets this extension fetch the schema, but VS Code's built-in JSON language server and the Red Hat YAML extension still fetch it themselves — and they don't share your credentials. The fix is to cache the schema to a local file.

Run JSON Schema: Cache Schema Locally (also offered directly by the lightbulb). The extension downloads the schema with your stored credentials and rewrites the json.schemas / yaml.schemas entry to point at the local copy. Both language servers then read it successfully — the squiggle disappears and IntelliSense works.

When the remote schema changes, run JSON Schema: Refresh Schema Cache to re-download the latest version, or enable jsonschema.cache.autoRefresh (see Configuration) to revalidate it automatically.

Released under the MIT License.