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:- Client Authentication - Clients prepare and send credentials with each request
- Server Authentication - Server validates credentials and identifies the user
- 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.Built-in Authentication Providers
Basic Authentication
Server Configuration
Client Configuration
Token Authentication
Server Configuration
Client Configuration
Default token header (Authorization: Bearer):Configuration Options
Server Settings
Fromchromadb/config.py:
Client Settings
Authorization
User Identity
Authentication providers return aUserIdentity object:
Authorization Actions
Available authorization actions fromchromadb/auth/__init__.py:
Authorization Resources
Custom Authentication Provider
Create a custom authentication provider:Security Best Practices
Production Deployment
- Always use HTTPS/SSL
- Store credentials securely
- Rotate credentials regularly
- Use strong passwords
- 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 (fromchromadb/config.py):
/api/v2- GET/api/v2/heartbeat- GET/api/v2/version- GET