You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ This mode is useful for:
82
82
83
83
## Authentication (Optional)
84
84
85
-
Sayna supports customer-based authentication that delegates token validation to an external authentication service. When enabled, protected API endpoints require a valid bearer token.
85
+
Sayna supports customer-based authentication that delegates token validation to an external authentication service. When enabled, protected API endpoints require a valid token provided either as `Authorization: Bearer <token>` or as `?api_key=<token>`.
@@ -471,8 +488,8 @@ Authentication errors return JSON responses with the following structure:
471
488
472
489
| Error Code | HTTP Status | Description |
473
490
|------------|-------------|-------------|
474
-
|`missing_auth_header`| 401 Unauthorized | Authorization header is missing from the request|
475
-
|`invalid_auth_header`| 401 Unauthorized | Authorization header format is invalid (not "Bearer {token}")|
491
+
|`missing_auth_header`| 401 Unauthorized |No token provided in either Authorization header or `api_key` query parameter|
492
+
|`invalid_auth_header`| 401 Unauthorized | Authorization header format is invalid and no valid `api_key` query parameter was provided|
476
493
|`unauthorized`| 401 Unauthorized | Token validation failed (auth service returned 401) |
477
494
|`auth_service_error`| 401 or 502 | Auth service returned an error (see below) |
478
495
|`auth_service_unavailable`| 503 Service Unavailable | Auth service is unreachable or timed out |
@@ -493,14 +510,14 @@ Sayna maps auth service responses to HTTP status codes as follows:
493
510
494
511
### Example Error Responses
495
512
496
-
**Missing Authorization Header:**
513
+
**Missing Token (header/query):**
497
514
```json
498
515
HTTP/1.1 401 Unauthorized
499
516
Content-Type: application/json
500
517
501
518
{
502
519
"error": "missing_auth_header",
503
-
"message": "Missing Authorization header"
520
+
"message": "Missing authentication token (Authorization header or api_key query parameter)"
504
521
}
505
522
```
506
523
@@ -750,7 +767,7 @@ The `iat` claim is a standard JWT field that indicates when the JWT was created.
750
767
751
768
| Error | Cause | Solution |
752
769
|-------|-------|----------|
753
-
| 401 Unauthorized | Missing or invalid token | Include valid `Authorization: Bearer {token}` header |
770
+
| 401 Unauthorized | Missing or invalid token | Include a valid `Authorization: Bearer {token}` header or `?api_key={token}` query parameter|
754
771
| 401 "Invalid API secret" | Token doesn't match any configured API secret | Check token matches one of the configured secrets (case-sensitive) |
755
772
| 500 "Auth required but no method configured" | AUTH_REQUIRED=true but no auth method set | Set either AUTH_API_SECRETS_JSON (or legacy AUTH_API_SECRET) or (AUTH_SERVICE_URL + AUTH_SIGNING_KEY_PATH) |
756
773
| 503 Service Unavailable | Auth service unreachable (JWT mode) | Verify auth service is running and reachable |
description: JWT token obtained from the authentication service. Required when AUTH_REQUIRED is enabled.
2019
+
bearerFormat: Token
2020
+
description: 'Authentication token for protected endpoints. Can be provided as `Authorization: Bearer <token>` or `?api_key=<token>`. Required when AUTH_REQUIRED is enabled.'
0 commit comments