Skip to main content
Chroma supports authentication for client-server deployments, allowing you to control access to your vector database.
Authentication is only applicable to client-server deployments. If you’re using Chroma in embedded mode, authentication is not available.

Authentication Overview

Architecture

Chroma uses a client-side and server-side authentication model:
  1. Client Authentication - Clients prepare and send credentials with each request
  2. Server Authentication - Server validates credentials and identifies the user
  3. Server Authorization - Server checks if the user has permission for the requested operation

Preemptive Authentication

Chroma uses preemptive authentication, meaning the client sends credentials with every request without waiting for a challenge from the server.
When using preemptive authentication, always use HTTPS in production to prevent credential exposure. Verify server certificates and use secure authentication providers.

Built-in Authentication Providers

Basic Authentication

Server Configuration

Or with Docker Compose:

Client Configuration

Token Authentication

Server Configuration

For multiple users with different tokens, use a configuration file:

Client Configuration

Default token header (Authorization: Bearer):
Custom token header:

Configuration Options

Server Settings

From chromadb/config.py:

Client Settings

Authorization

User Identity

Authentication providers return a UserIdentity object:

Authorization Actions

Available authorization actions from chromadb/auth/__init__.py:

Authorization Resources

Custom Authentication Provider

Create a custom authentication provider:
Configure server to use custom provider:

Security Best Practices

Production Deployment

  1. Always use HTTPS/SSL
  1. Store credentials securely
  1. Rotate credentials regularly
  2. Use strong passwords
  1. Restrict network access

Client Security

Testing Authentication

Positive Test

Negative Test

Troubleshooting

Authentication Failed

Wrong Provider

Ensure client and server providers match:

SSL Certificate Errors

Public Endpoints

Some endpoints are public by default (from chromadb/config.py):
  • /api/v2 - GET
  • /api/v2/heartbeat - GET
  • /api/v2/version - GET
To authenticate these, modify server settings: