This document explains the login system for the InferIQ application (formerly known as Deductive Reasoning Framework).
The login system is designed to be simple yet secure, using a JSON file to store user credentials instead of a database. The system includes:
- User authentication with bcrypt password hashing
- Role-based access control (Admin and User roles)
- Self-registration option for new users
- User management interface for admins
- Password reset functionality
- First-login password change requirement
- Import/export users via CSV
The system creates a default admin user if no users exist:
- Username:
admin - Password:
admin
You will be prompted to change this password on first login.
As an admin, you have access to the User Management page where you can:
- View all users in the system
- Create new users
- Reset passwords for existing users
- Delete users
- Export users to CSV
- Import users from CSV
New users can self-register through the Register tab on the login page. This feature can be:
- Enabled/disabled by setting the
ENABLE_REGISTRATIONenvironment variable to "true" or "false" - Protected with a registration code by setting
REQUIRE_REGISTRATION_CODEto "true" and setting a code withREGISTRATION_CODE
The login system can be configured using environment variables in the .env file:
# Storage path for all file storage
INFERIQ_STORAGE=/data/storage
# Enable or disable self-registration (default: true)
ENABLE_REGISTRATION=true
# Require a registration code for self-registration (default: false)
REQUIRE_REGISTRATION_CODE=false
# Set the registration code if required
REGISTRATION_CODE=your_secret_code
The INFERIQ_STORAGE environment variable defines where all application data is stored, including:
- User credentials (users.json)
- Uploaded files
- Data management files
- Trained models
By default, if this variable is not set, the application will store files in the application directory.
User data is stored in users.json in the storage directory defined by INFERIQ_STORAGE. The file structure is:
{
"username": {
"password": "bcrypt_hashed_password",
"role": "Admin or User",
"first_login": true/false
},
...
}If the storage directory doesn't exist, it will be created automatically when needed.
- Passwords are hashed using bcrypt
- The system enforces password confirmation for all password-related operations
- Only admins can manage other users
- Users are forced to change their password on first login
If you need to add users without admin access, you can:
- Temporarily enable self-registration by setting
ENABLE_REGISTRATION=true - Manually edit the
users.jsonfile (make sure to hash passwords with bcrypt) - Use the CSV import feature if you have admin access
If you lose admin access or have issues logging in:
- Stop the application
- Run the reset_admin.py script to reset the admin user:
python deductive_reasoning_framework/reset_admin.py - This will create a fresh admin user with username "admin" and password "admin" in the storage location defined by
INFERIQ_STORAGE - Restart the application and log in with these credentials
- You will be prompted to change the password on first login
InferIQ is an intelligent inference and reasoning engine that provides:
- Data and rule management
- Inference and validation
- Hyper-parameter tuning
- User management
The application uses a combination of deductive reasoning, Bayesian networks, probabilistic programming, and machine learning to provide accurate inferences with confidence scores.