POST /api/admin/puzzles- Add puzzleDELETE /api/admin/puzzles/{id}- Delete puzzlePOST /api/admin/puzzles/delete-bulk- Delete multiple puzzlesGET /api/admin/puzzles- Get all puzzlesPOST /api/admin/puzzles/upload-bulk- Bulk upload
GET /api/user/all- List all users
No authentication required! Admin endpoints work out of the box.
# Start server
dotnet run --project src/server
# Test admin endpoint (works without auth)
curl http://localhost:5000/api/user/allSet environment variable:
# Linux/Mac
export Auth__AdminApiKey="your-secret-production-key-abc123"
# Windows PowerShell
$env:Auth__AdminApiKey="your-secret-production-key-abc123"
# Docker
docker run -e Auth__AdminApiKey="your-secret-key" ...Or update appsettings.Production.json:
{
"Auth": {
"BypassInDevelopment": false,
"AdminApiKey": "your-secret-production-key"
}
}Client usage:
fetch('/api/user/all', {
headers: {
'X-Admin-Key': 'your-secret-production-key'
}
})See AUTHENTICATION-SETUP.md for full Azure AD setup.
See AUTHENTICATION-SETUP.md for full Google OAuth setup.
Want to test authentication locally?
1. Update appsettings.Development.json:
{
"Auth": {
"BypassInDevelopment": false,
"AdminApiKey": "test-key-123"
}
}2. Add header to requests:
curl -H "X-Admin-Key: test-key-123" http://localhost:5000/api/user/all| File | Environment | Auth Behavior |
|---|---|---|
appsettings.json |
Base | Has auth config template |
appsettings.Development.json |
Development | BypassInDevelopment: true (no auth) |
appsettings.Production.json |
Production | BypassInDevelopment: false (auth required) |
β
Set the Auth__AdminApiKey environment variable
β
Check BypassInDevelopment: true in appsettings.Development.json
β
Verify the header name is exactly X-Admin-Key (case-sensitive)
β
Check environment variable format: Auth__AdminApiKey (double underscore)
- Never commit API keys to source control
- Use different keys for each environment
- Rotate keys regularly (at least quarterly)
- Use Azure KeyVault or AWS Secrets Manager in production
- Enable HTTPS (handled by reverse proxy/load balancer)
- Monitor failed auth attempts in application logs
- Full setup guide:
AUTHENTICATION-SETUP.md - Code:
src/server/Auth/AdminAuthHandler.cs - Configuration:
src/server/Program.cs