Authentication Methods
CVAT implements the following authentication methods defined incvat/settings/base.py:136-141:
- Token Authentication: API token-based authentication
- Access Token Authentication: Bearer token authentication
- Session Authentication: Cookie-based session authentication
- Basic Authentication: HTTP Basic authentication
Default Authentication Backends
Configured incvat/settings/base.py:250-253:
Django Model Backend
The default Django authentication backend that authenticates against the PostgreSQL database using username/email and password.Django-allauth Backend
Provides advanced authentication features including:- Email verification
- Social authentication support
- Account management
cvat/settings/base.py:255-263 for allauth configuration.
REST API Authentication
REST API authentication classes defined incvat/settings/base.py:136-141:
Token Authentication
Django REST Framework’s built-in token authentication. Users receive a token upon login that must be included in theAuthorization header:
Access Token Authentication
Custom bearer token authentication for API access tokens. Implemented incvat/apps/access_tokens/authentication.py:11-27.
Tokens are passed in the Authorization header:
- Validates token against the database
- Checks user active status
- Updates last use timestamp
- Raises
AuthenticationFailedfor invalid or expired tokens
Session Authentication
Cookie-based authentication for web browsers. Sessions are stored in Redis and managed by Django. Session configuration incvat/settings/base.py:423:
Basic Authentication Extended
Custom implementation incvat/apps/iam/authentication.py:12-26 that extends Django REST Framework’s BasicAuthentication with email verification:
Account Configuration
Account authentication settings incvat/settings/base.py:256-263:
Username Requirements
Defined incvat/settings/base.py:693:
Email Verification
Email verification can be configured to:- none: No email verification required (default)
- optional: Email verification is optional
- mandatory: Email must be verified before access is granted
Email Configuration Example
Create a custom settings file based oncvat/settings/email_settings.py:1-17:
EMAIL_BACKEND is set to None in cvat/settings/base.py:754, which will raise an error if email functionality is needed without proper configuration.
Identity and Access Management (IAM)
IAM settings incvat/settings/base.py:223-233:
User Roles
Three built-in roles with descending priority:- admin: Full system access
- user: Standard user access
- worker: Limited access for annotation workers
Password Validation
Password validators defined incvat/settings/base.py:397-410:
Login URLs and Redirects
Defined incvat/settings/base.py:233-234:
Open Policy Agent (OPA)
CVAT uses OPA for authorization decisions. Configuration indocker-compose.yml:313-330:
/api/auth/rules.
API Rate Limiting
Throttle configuration incvat/settings/base.py:158-163:
Custom Authentication Adapter
Custom account adapter incvat/settings/base.py:696:
Security Settings
HTTPS Configuration
Configured incvat/settings/base.py:601-609:
CORS Configuration
CORS headers defined incvat/settings/base.py:585-596:
API Documentation
CVAT provides interactive API documentation with authentication support. Configuration incvat/settings/base.py:617-689:
- Swagger UI:
http://your-host:8080/api/docs - ReDoc:
http://your-host:8080/api/redoc - OpenAPI Schema:
http://your-host:8080/api/schema
Next Steps
- SSO and LDAP Configuration - Enterprise SSO integration
- Configuration - General configuration options
Additional Resources
- Source:
cvat/apps/iam/authentication.py - Source:
cvat/apps/access_tokens/authentication.py - Source:
cvat/settings/base.py:223-263 - Django Authentication Documentation
- Django REST Framework Authentication
- Django-allauth Documentation