Skip to main content

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

  1. Enable the module in your module configuration:
// config/modules.php or via admin panel
'UidLogin' => true,
  1. Run the module migrations:
php artisan module:migrate UidLogin
  1. Publish the module assets:
php artisan module:publish UidLogin

Configuration

Module Settings

Access UID Login settings through Settings > UID Login:

SettingDescriptionDefault
Enable UID LoginEnable/disable UID login functionalityDisabled
UID FieldEmployee field to use as UIDEmployee ID
Require PINRequire PIN in addition to UIDNo
PIN LengthNumber of digits for PIN4
Device RestrictionLimit UID login to specific devicesNo
Session DurationHow long UID login sessions last8 hours
Allowed RolesRoles that can use UID loginAll Employees

Employee UID Setup

Each employee needs a unique identifier configured:

  1. Go to Employees > Edit Employee
  2. Navigate to the Authentication or Security tab
  3. Set the UID field (auto-generated or custom)
  4. Optionally set a PIN if PIN requirement is enabled

Usage

Basic UID Login

  1. Navigate to the UID login page (e.g., /uid-login)
  2. Enter your UID or scan your badge/QR code
  3. If PIN is required, enter your PIN
  4. You are now logged in

QR Code Login

  1. On the UID login page, click Scan QR Code
  2. Allow camera access if prompted
  3. Hold your badge or QR code to the camera
  4. 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:

  1. Set up a dedicated device for UID login
  2. Register the device in Settings > UID Login > Authorized Devices
  3. Configure auto-logout after inactivity
  4. 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

  1. Enable PIN: Add PIN requirement for moderate security
  2. Device Binding: Restrict UID login to known, secured devices
  3. Short Sessions: Use shorter session durations for UID logins
  4. Audit Logging: Monitor UID login attempts and patterns
  5. 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:

  1. Configure the reader to send UID to the input field
  2. Set up auto-submit on UID input
  3. 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