API Key Authentication
API Key authentication lets you send a custom header or query parameter with your API key.- Header-Based
- Query Parameter
Configure API key in a custom header:This sends:
Example configuration:
X-API-Key: your-api-key-hereBearer Token Authentication
Bearer Token authentication is commonly used for JWT-based APIs and OAuth 2.0 access tokens.
Example configuration:
Bearer tokens support variable substitution. Store tokens in environment variables so you can use different tokens for local, staging, and production.
Basic Authentication
Basic Auth sends username and password credentials encoded in Base64.Enter Credentials
- Username: Your username or
{{username}}variable - Password: Your password or
{{password}}variable
OAuth 2.0 Authentication
LiteClient provides comprehensive OAuth 2.0 support with three grant types and automatic token management.Authorization Code Flow
Traditional OAuth 2.0 flow with browser-based authentication.Configure Endpoints
- Authorization URL: The provider’s authorization endpoint
- Token URL: The provider’s token endpoint
- Client ID: Your application’s client ID
- Client Secret: Your application’s client secret (if required)
- Redirect URI:
vscode://liteclienthq.liteclient/oauth2/callback - Scope: Space-separated scopes (e.g.,
read write)
Authorize
Log in and authorize the application. LiteClient receives the callback and exchanges the code for an access token.
Authorization Code with PKCE
Enhanced security flow for public clients (recommended for most use cases).PKCE (Proof Key for Code Exchange) is more secure than standard Authorization Code flow and doesn’t require a client secret. Use PKCE when available.
Client Credentials Flow
Machine-to-machine authentication without user interaction.Configure Credentials
- Token URL: The provider’s token endpoint
- Client ID: Your application’s client ID
- Client Secret: Your application’s client secret
- Scope: Optional scopes
- Audience: Optional audience parameter
Token Caching and Refresh
LiteClient automatically manages OAuth 2.0 tokens:- Secure Storage: Tokens are stored in VS Code’s SecretStorage (encrypted)
- Automatic Caching: Tokens are reused across requests until expiration
- Auto Refresh: When tokens expire, LiteClient automatically requests a new token using the refresh token (if available)
- Per-Configuration: Each OAuth 2.0 configuration maintains its own token cache
Token refresh happens automatically when you send a request with an expired token. You don’t need to manually refresh tokens.
Using Variables in Authentication
All authentication types support variable substitution:- Use different credentials per environment
- Avoid hardcoding secrets in requests
- Share collections without exposing credentials
Best Practices
Use environment variables for credentials
Use environment variables for credentials
Store all API keys, tokens, usernames, and passwords in environment variables. Mark them as
secret type to mask them in the UI.Use PKCE for OAuth 2.0
Use PKCE for OAuth 2.0
When the API supports it, prefer Authorization Code with PKCE over standard Authorization Code for better security.
Separate credentials per environment
Separate credentials per environment
Create separate environments for local, staging, and production with different API keys and OAuth credentials for each.
Never commit secrets to version control
Never commit secrets to version control
Use current values for local testing instead of initial values. Current values are never committed to Git.
Use Client Credentials for backend services
Use Client Credentials for backend services
For server-to-server API calls, use Client Credentials flow instead of Authorization Code to avoid interactive login.