Authentication Profiles

Centralize and reuse authentication credentials across multiple database connections with support for OAuth2, OIDC, and other modern authentication methods.

Authentication Profiles provide a centralized way to manage authentication credentials that can be shared across multiple database connections. This feature is particularly useful for modern authentication methods like OAuth2 and OIDC, where credential management can be complex.

Key Benefits

  • Credential Reuse: Define authentication once, use across multiple connections
  • Centralized Management: Update credentials in one place for all connections
  • Secure Storage: Sensitive values stored in VS Code’s secure credential storage
  • Modern Auth Support: First-class support for OAuth2, OIDC, and other token-based authentication
  • Workspace & Global Scope: Share profiles across your team or keep them personal

Supported Authentication Types

TypeDescriptionDocumentation
OAuth2 / OIDCToken-based authentication with support for Authorization Code and Client Credentials flowsOAuth2 Guide

Creating an Authentication Profile

From the Authentication Profiles View

  1. Open the DBCode activity bar
  2. Navigate to the Authentication Profiles section
  3. Click the + (Create) icon in the view title bar
  4. Select the authentication type (e.g., OAuth2)
  5. Fill in the required fields
  6. Choose storage location for each field:
    • Secret Storage: Encrypted, not visible in settings files
    • Settings JSON: Visible in settings, suitable for non-sensitive values
  7. Choose scope:
    • User (Global): Available across all workspaces
    • Workspace: Only available in current workspace
  8. Click Save

From a Connection Form

When creating or editing a connection that supports authentication profiles:

  1. Find the Authentication section
  2. Click Create New Profile in the auth profile dropdown
  3. Complete the profile setup (same as above)
  4. The new profile will be automatically selected for your connection

Managing Authentication Profiles

Editing a Profile

From the Tree View:

  • Right-click the profile → Edit
  • Or click the pencil icon

From Command Palette:

  • Run DBCode: Edit Auth Profile
  • Select the profile to edit

Deleting a Profile

From the Tree View:

  • Right-click the profile → Delete
  • Or click the trash icon

Restrictions:

  • Profiles in use by connections cannot be deleted
  • Delete or reassign connections first

Viewing Profile Details

Hover over a profile in the tree view to see:

  • Profile name
  • Authentication type
  • Scope (User/Workspace)

Using Authentication Profiles in Connections

When creating or editing a connection:

  1. Look for the Auth Profile dropdown in the connection form
  2. Select an existing profile, or create a new one
  3. Save the connection

The connection will use the profile’s credentials for authentication. If the profile uses OAuth2, you’ll be prompted to authenticate via your browser when connecting.

Storage and Security

Secret Storage

Sensitive values (passwords, client secrets, tokens) are stored in VS Code’s secure credential storage:

  • macOS: Keychain
  • Windows: Credential Manager
  • Linux: Secret Service API (gnome-keyring, kwallet)

Settings JSON

Non-sensitive configuration (URLs, client IDs, scopes) can be stored in VS Code settings:

  • User Settings: ~/.vscode/settings.json or ~/Library/Application Support/Code/User/settings.json
  • Workspace Settings: .vscode/settings.json in your workspace

You control which fields go where when creating or editing a profile.

Best Practices

Scope Selection

Use Global (User) scope when:

  • Credentials are personal to you
  • You connect to the same resources across multiple projects
  • The authentication is tied to your user account

Use Workspace scope when:

  • Credentials are shared with your team (committed to version control)
  • Authentication is specific to a project
  • You want to keep work and personal profiles separate

Troubleshooting

”Auth profile not found”

Cause: Profile was deleted or moved between scopes

Solutions:

  • Recreate the profile or select a different one
  • Check if the profile exists in the correct scope (User vs Workspace)

“Profile in use by connections”

Cause: Attempting to delete a profile that’s assigned to connections

Solutions:

  • Edit connections using the profile and change their auth method
  • Or assign a different profile to those connections