UpdaterAgent uses JWT-based authentication with short-lived access tokens and long-lived refresh tokens stored in HttpOnly cookies. Every protected endpoint requires a valid Bearer token. Authorization is permission-based: each user is assigned a role, and each role carries a set of granular permissions that are embedded directly in the JWT.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ShohjahonSohibov/repo-for-agent/llms.txt
Use this file to discover all available pages before exploring further.
Access token
After a successful login, you receive a JWT access token valid for 1 hour. Token lifetime: 1 hour (JwtOptions.ExpiryMinutes: 60)
Claims embedded in the token:
| Claim | Value | Description |
|---|---|---|
sub | User ID | Identifies the authenticated user |
email | user@example.com | User’s email address |
tenantId | Tenant ID | Determines which tenant’s data the user can access |
sessionId | Session ID | Links the token to a specific session for revocation |
permissions | ["Loads.View", "Loads.Create", ...] | Flattened list of all granted permissions |
iat | Unix timestamp | When the token was issued |
exp | Unix timestamp | When the token expires |
Refresh token
A refresh token is issued alongside the access token and stored as an HttpOnly cookie namedrefresh-token. It cannot be read by JavaScript, which prevents XSS attacks from stealing it.
Cookie name: refresh-tokenToken lifetime: 7 days (
JwtOptions.RefreshTokenExpiryDays: 7)Cookie flags:
HttpOnly; Secure; SameSite=Strict
How to authenticate
Send aPOST request with your email and password:
refresh-token cookie is set automatically by the server response. Store the accessToken in memory (not in localStorage) to minimize XSS exposure.
How to use the token
Include the access token in theAuthorization header of every API request:
Refreshing the token
When the access token expires, request a new one. No request body is required — the server reads therefresh-token cookie automatically:
accessToken with a fresh 1-hour expiry. The refresh token itself remains valid for the remainder of its 7-day window.
Permission-based access control
Every API endpoint that modifies or reads sensitive data is guarded by the[HasPermission] attribute. Permissions are resolved from JWT claims on each request — no database call is required for authorization checks.
Permissions are organized into groups by feature area:
| Group | Example permissions |
|---|---|
| Loads | Loads.View, Loads.Create, Loads.Update, Loads.Delete, Loads.Export |
| Drivers | Drivers.View, Drivers.Create, Drivers.Update, Drivers.Delete |
| Users | Users.View, Users.Create, Users.Update, Users.Delete |
| Reports | Reports.View, Reports.Export |
| Tickets | Tickets.View, Tickets.Create, Tickets.Update |
403 Forbidden.
Common authentication errors
| HTTP status | Error code | Cause |
|---|---|---|
401 | Auth.InvalidCredentials | Email or password is incorrect |
401 | Auth.Unauthorized | Token is missing, malformed, or expired |
401 | Auth.TokenExpired | Access token has expired — refresh it |
401 | Auth.SessionInactive | The session was revoked (logout or password change) |
403 | Auth.Forbidden | Token is valid but lacks the required permission |
Session management
Each login creates a session record that tracks the device name (User-Agent) and IP address. You can list and revoke sessions:| Action | Endpoint |
|---|---|
| List active sessions | GET /api/auth/sessions |
| Revoke a specific session | DELETE /api/auth/sessions/{id} |
| Log out (current session) | POST /api/auth/logout |
Security features
Password storage
Password storage
Passwords are hashed with BCrypt before storage. Plain-text passwords are never logged or persisted. Password validation requires a minimum of 8 characters with configurable complexity rules.
JWT signing
JWT signing
Tokens are signed with HMAC-SHA256 using a secret key configured in
JwtOptions.SecretKey. Tokens with invalid signatures are rejected before claims are read.Cookie security
Cookie security
CORS and HTTPS
CORS and HTTPS
CORS is configured with an explicit allow-list of origins. All production traffic must travel over HTTPS. Security headers including
Content-Security-Policy and X-Frame-Options are applied by middleware.