Skip to content

Authentication

Jina Connect uses JWT (JSON Web Tokens) for REST API authentication and API Keys for MCP server access.

Terminal window
curl -X POST http://localhost:8000/token/ \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "your-password"
}'

Response:

{
"access": "eyJhbGciOiJIUzI1NiIs...",
"refresh": "eyJhbGciOiJIUzI1NiIs..."
}
TokenLifetimeAlgorithm
Access90 days (configurable via ACCESS_TOKEN_LIFETIME)HS256
Refresh180 daysHS256
Terminal window
curl -X POST http://localhost:8000/refresh/ \
-H "Content-Type: application/json" \
-d '{
"refresh": "eyJhbGciOiJIUzI1NiIs..."
}'

Include the access token in the Authorization header:

Terminal window
curl http://localhost:8000/tenants/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

API keys (TenantAccessKey) are used for:

  • MCP server tool calls
  • External system integrations
  • Server-to-server communication

Create API keys via the admin panel or API:

Terminal window
curl -X POST http://localhost:8000/tenants/tenant-access-keys/ \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "My Integration Key"}'

API keys resolve to a specific (Tenant, TenantWAApp) pair.

MethodEndpointDescription
GET/users/user/List users / Get current user
POST/users/user/Register new user
PATCH/users/user/{id}/Update user profile

The DRF configuration accepts both JWT and Basic auth:

REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthentication',
'rest_framework.authentication.BasicAuthentication',
],
}
ScopeRate
Default2000 requests/day

Custom throttle rates can be set per-viewset.