2.6 KiB
2.6 KiB
Authentication and Security
User Authentication
General Bots provides robust authentication with:
- Argon2 password hashing for secure credential storage
- Session management tied to user identity
- Anonymous user support for guest access
Authentication Flow
- Client requests
/api/authendpoint with credentials - System verifies credentials against stored hash
- New session is created or existing session is returned
- Session token is provided for subsequent requests
Password Security
- All passwords are hashed using Argon2 (winner of Password Hashing Competition)
- Random salt generation for each password
- Secure password update mechanism
- Password management delegated to Directory Service
API Endpoints
GET /api/auth
Authenticates user and returns session
Parameters:
bot_name: Name of bot to authenticate againsttoken: Authentication token (optional)
Response:
{
"user_id": "uuid",
"session_id": "uuid",
"status": "authenticated"
}
User Management
Creating Users
Users are created through the Directory Service with randomly generated initial passwords.
Verifying Users
User verification is handled through the Directory Service OAuth2/OIDC flow.
Updating Passwords
Password updates are managed through the Directory Service's built-in password reset workflows.
Bot Authentication
- Bots can be authenticated by name
- Each bot can have custom authentication scripts
- Authentication scripts are stored in
.gbdialog/auth.ast
// Example bot auth script
IF token != generated_token THEN
RETURN false
ENDIF
RETURN true
Security Considerations
- All authentication requests are logged
- Failed attempts are rate-limited
- Session tokens have limited lifetime
- Password hashes are never logged
See Also
- Services Overview - System services architecture
- Compliance Requirements - Security and compliance
- Chapter 1: Installation - Initial setup
- Chapter 2: Packages - Bot package system
- Chapter 3: Knowledge Base - KB infrastructure
- Chapter 7: Configuration - System configuration
- Chapter 9: Storage - Storage architecture
- Chapter 10: Development - Development environment
- Chapter 12: Web API - API endpoints