Route Auth vs. Basic Auth
🔒 Security
·
Updated 1 month ago
Comparison table
| Property | No Auth | Basic Auth | Route Auth |
|---|---|---|---|
| Security level | None | Medium | High |
| Login UI | None | Browser dialog | Custom login page |
| Password storage | — | bcrypt | bcrypt |
| 2FA possible | No | No | Yes |
| Session/Logout | — | No/No | Yes/Yes |
| API-compatible | Yes | Yes (curl -u) |
No (cookie-based) |
| Custom branding | — | No | Yes |
| Accounts per route | — | 1 | 1 |
| Email required | No | No | Yes (for email methods) |
| SMTP required | No | No | Only for Email Code |
| Works with L4 | — | No | No |
Setup
Basic Auth via the UI
- Create or edit a route
- Auth Type: select Basic Auth
- Enter username and password
- Save
Route Auth via the UI
- Create or edit a route
- Auth Type: select Route Auth
- Choose a method (Email & Password, Email & Code, TOTP)
- Optional: enable 2FA and choose the second factor
- Enter email and password if applicable
- Save
- For TOTP: reopen the route and scan the QR code
Via the API
# Enable Basic Auth
curl -X PUT https://gatecontrol.example.com/api/v1/routes/1 \
-H "Authorization: Bearer gc_..." \
-H "Content-Type: application/json" \
-d '{
"basic_auth_enabled": true,
"basic_auth_user": "admin",
"basic_auth_password": "my-secure-password"
}'
# Enable Route Auth (Email & Password)
curl -X PUT https://gatecontrol.example.com/api/v1/routes/1 \
-H "Authorization: Bearer gc_..." \
-H "Content-Type: application/json" \
-d '{
"auth_type": "route",
"route_auth_method": "email_password",
"route_auth_email": "admin@example.com",
"route_auth_password": "my-secure-password"
}'