UID Login
This module enables passwordless one-tap login for employees.
Overview
The UID Login module provides a simplified authentication method that allows employees to log in using a unique identifier (UID) without requiring a password. This is particularly useful for environments where quick access is needed, such as manufacturing floors, retail locations, or kiosk-based systems.
Features
- UID-Based Authentication: Login using unique employee identifiers
- One-Tap Login: Quick access without password entry
- Simplified Employee Access: Reduced friction for frequent logins
- QR Code Support: Scan employee badge or QR code for instant login
- PIN Option: Optional PIN requirement for added security
- Device Binding: Restrict UID login to authorized devices
- Session Management: Configure session duration for UID logins
Requirements
- Open Core Business Suite (Base System)
- No additional module dependencies
Installation
- Enable the module in your module configuration:
// config/modules.php or via admin panel
'UidLogin' => true,
- Run the module migrations:
php artisan module:migrate UidLogin
- Publish the module assets:
php artisan module:publish UidLogin
Configuration
Module Settings
Access UID Login settings through Settings > UID Login:
| Setting | Description | Default |
|---|---|---|
| Enable UID Login | Enable/disable UID login functionality | Disabled |
| UID Field | Employee field to use as UID | Employee ID |
| Require PIN | Require PIN in addition to UID | No |
| PIN Length | Number of digits for PIN | 4 |
| Device Restriction | Limit UID login to specific devices | No |
| Session Duration | How long UID login sessions last | 8 hours |
| Allowed Roles | Roles that can use UID login | All Employees |
Employee UID Setup
Each employee needs a unique identifier configured:
- Go to Employees > Edit Employee
- Navigate to the Authentication or Security tab
- Set the UID field (auto-generated or custom)
- Optionally set a PIN if PIN requirement is enabled
Usage
Basic UID Login
- Navigate to the UID login page (e.g.,
/uid-login) - Enter your UID or scan your badge/QR code
- If PIN is required, enter your PIN
- You are now logged in
QR Code Login
- On the UID login page, click Scan QR Code
- Allow camera access if prompted
- Hold your badge or QR code to the camera
- Login occurs automatically upon successful scan
Mobile App Integration
The UID login can be integrated with the employee mobile app:
// Flutter example
final response = await api.post('/api/V1/auth/uid-login', {
'uid': employeeUid,
'device_id': deviceId,
});
Kiosk Mode
For kiosk deployments:
- Set up a dedicated device for UID login
- Register the device in Settings > UID Login > Authorized Devices
- Configure auto-logout after inactivity
- Use fullscreen mode for a dedicated login experience
API Endpoints
UID Login
POST /api/V1/auth/uid-login
Content-Type: application/json
{
"uid": "EMP001",
"pin": "1234", // Optional, if PIN required
"device_id": "device-uuid" // Optional, for device binding
}
Response:
{
"success": true,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"user": {
"id": 1,
"name": "John Doe",
"employee_id": "EMP001"
}
}
Validate UID
POST /api/V1/auth/validate-uid
Content-Type: application/json
{
"uid": "EMP001"
}
Generate New UID
POST /api/V1/employees/{id}/generate-uid
Generates a new unique UID for the specified employee.
Security Considerations
When to Use UID Login
UID login is appropriate for:
- Low-security environments: Where convenience outweighs strict security
- Supervised access points: Where physical security is controlled
- Time-sensitive operations: Where quick login is critical
- Shared devices: Kiosks or terminals used by multiple employees
When NOT to Use UID Login
Avoid UID login for:
- Sensitive data access: Financial, HR, or confidential information
- Remote access: Unsupervised or public network access
- Administrative functions: System configuration or user management
Best Practices
- Enable PIN: Add PIN requirement for moderate security
- Device Binding: Restrict UID login to known, secured devices
- Short Sessions: Use shorter session durations for UID logins
- Audit Logging: Monitor UID login attempts and patterns
- Physical Security: Ensure UID badges are not easily shared
Badge/Card Integration
Generating QR Codes
Generate employee QR codes for badge printing:
use Modules\UidLogin\Services\UidService;
$qrCode = $uidService->generateQRCode($employee->uid);
// Returns PNG image data for the QR code
RFID/NFC Integration
For RFID or NFC badge readers:
- Configure the reader to send UID to the input field
- Set up auto-submit on UID input
- Reader sends badge ID directly to UID login endpoint
Troubleshooting
UID Not Recognized
- Verify employee has a UID assigned
- Check UID matches exactly (case-sensitive)
- Ensure employee account is active
Device Not Authorized
- Register the device in authorized devices list
- Check device ID is being sent correctly
- Verify device restriction is enabled
Session Expires Too Quickly
- Adjust session duration in settings
- Check for conflicting session configurations
- Verify user activity is being tracked
QR Code Not Scanning
- Ensure adequate lighting
- Check camera permissions
- Verify QR code is not damaged or faded
- Try manual UID entry as fallback