Overview
Simulation Mode allows you to run RDSWeb Custom without requiring:
- An Active Directory domain controller
- An RD Connection Broker server
- Real RemoteApp publications
This is ideal for:
- Local development
- CI/CD testing
- Demos and proof-of-concept environments
- Frontend UI development
Enabling Simulation Mode
Set this in your .env file:
Never enable simulation mode in production! This bypasses all Active Directory authentication.
How It Works
When simulation mode is enabled:
- Authentication: Uses hardcoded test users instead of AD (see
backend/src/services/adService.js:5-22)
- Applications: Returns a static list of RemoteApps (see
backend/src/services/rdcbService.js:4-54)
- No External Dependencies: No LDAP or WMI queries are executed
Simulated Users
Two test users are available in simulation mode:
Administrator User
{
username: 'administrador',
password: 'Admin1234!',
displayName: 'Administrador',
email: '[email protected]',
domain: 'LAB-MH',
groups: ['RemoteApp Users', 'Domain Admins']
}
Standard User
{
username: 'juan.perez',
password: 'Usuario1234!',
displayName: 'Juan Pérez',
email: '[email protected]',
domain: 'LAB-MH',
groups: ['RemoteApp Users']
}
Simulated Applications
The following RemoteApps are returned in simulation mode:
- Microsoft Word 2019 (
MSWORD)
- Microsoft Excel 2019 (
MSEXCEL)
- Microsoft PowerPoint 2019 (
MSPOWERPOINT)
Application Data Structure
Each simulated app includes:
{
alias: 'MSWORD', // Unique identifier
name: 'Microsoft Word 2019', // Display name
rdpPath: '||MSWORD', // RDP launch path
iconIndex: 0, // Icon index
remoteServer: 'SRV-APPS.LAB-MH.LOCAL', // RDCB server
folderName: 'Microsoft Office' // Category folder
}
Simulated Desktops
One desktop resource is available:
{
alias: 'DESKTOP_DEFAULT',
name: 'Escritorio Remoto',
rdpPath: null, // Full desktop session
remoteServer: 'SRV-APPS.LAB-MH.LOCAL',
folderName: 'Escritorios'
}
Configuration
You can customize the simulated user credentials in .env:
SIMULATION_MODE=true
SIMULATION_USER=administrador
SIMULATION_PASS=Admin1234!
These settings define the default simulated user, but both hardcoded users in adService.js will work regardless of these values.
Testing with Simulation Mode
Login Test
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "administrador",
"password": "Admin1234!"
}'
Expected Response:
{
"success": true,
"user": {
"username": "administrador",
"displayName": "Administrador",
"email": "[email protected]",
"domain": "LAB-MH",
"groups": ["RemoteApp Users", "Domain Admins"]
}
}
Get Applications
curl http://localhost:3000/api/apps \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Expected Response:
{
"apps": [
{
"alias": "MSWORD",
"name": "Microsoft Word 2019",
"rdpPath": "||MSWORD",
"folderName": "Microsoft Office"
}
// ... more apps
],
"desktops": [
{
"alias": "DESKTOP_DEFAULT",
"name": "Escritorio Remoto",
"folderName": "Escritorios"
}
]
}
Health Check
Verify simulation mode is active:
curl http://localhost:3000/api/health
Response:
{
"status": "ok",
"simulationMode": true,
"rdcbServer": "SRV-APPS.LAB-MH.LOCAL",
"timestamp": "2026-03-04T10:30:00.000Z"
}
Adding Custom Simulated Data
Adding a User
Edit backend/src/services/adService.js and add to the SIMULATED_USERS array:
const SIMULATED_USERS = [
// ... existing users
{
username: 'jane.doe',
password: 'SecurePass123!',
displayName: 'Jane Doe',
email: '[email protected]',
domain: 'LAB-MH',
groups: ['RemoteApp Users', 'Developers'],
},
];
Adding an Application
Edit backend/src/services/rdcbService.js and add to the SIMULATED_APPS array:
const SIMULATED_APPS = [
// ... existing apps
{
alias: 'VSCODE',
name: 'Visual Studio Code',
rdpPath: '||VSCODE',
iconIndex: 0,
remoteServer: config.rdcb.server,
folderName: 'Herramientas',
},
];
Adding a Desktop Collection
Edit the SIMULATED_DESKTOPS array in rdcbService.js:
const SIMULATED_DESKTOPS = [
// ... existing desktops
{
alias: 'DESKTOP_DEVELOPERS',
name: 'Escritorio de Desarrollo',
rdpPath: null,
remoteServer: config.rdcb.server,
folderName: 'Escritorios',
},
];
Switching Between Modes
To switch from simulation to production mode:
Configure Real Services
Ensure AD and RDCB settings are configured:LDAP_URL=ldap://dc01.contoso.local
RDCB_SERVER=rdcb.contoso.local
AD_SERVICE_USER=[email protected]
AD_SERVICE_PASS=YourPassword
Restart Backend
cd ~/workspace/source/backend
npm start
Verify Mode
Check the health endpoint:curl http://localhost:3000/api/health
Should show "simulationMode": false
Visual Indicator
When the backend starts, it displays the current mode:
╔══════════════════════════════════════╗
║ RDWeb-Moderno Backend ║
║ Servidor en puerto 3000 ║
║ Modo: SIMULACIÓN 🟡 ║
║ RDCB: SRV-APPS.LAB-MH.LOCAL ║
╚══════════════════════════════════════╝
Production mode shows:
CI/CD Integration
For automated testing, enable simulation mode in your CI pipeline:
# .github/workflows/test.yml
env:
SIMULATION_MODE: true
JWT_SECRET: test_secret_for_ci
steps:
- name: Run Backend Tests
run: |
cd backend
npm install
npm test
Limitations
Simulation mode has these limitations:
- No real RDP connections (frontend can generate RDP files, but they won’t work)
- No group-based filtering (all simulated users see all apps)
- No password policies or account lockouts
- No session management or token revocation
Security Reminder
Disable in Production
Never use simulation mode in production environments
No Real Auth
Simulation mode bypasses all authentication checks
Demo Only
Use only for demos, development, and testing
Check Health Endpoint
Always verify simulation mode status before deployment
Related Pages