Control runtime user accounts.
Reference → Modules → Security → UI → RuntimeUsers | Users | Permissions | Policies | Identity Providers | Secrets | Monitor
Security RuntimeUsers (Reference): Dynamic user management during runtime, allowing user creation and authentication without modifying solution configuration.
RuntimeUsers provide:
RuntimeUsers combined with SecurityUsers form the complete Solution Users.
| Aspect | SecurityUsers | RuntimeUsers |
|---|---|---|
| Creation | Design-time only | Runtime only |
| Storage | Solution file | External database |
| Engineering Access | Yes | No |
| Modify Solution | Yes | No |
| Runtime Access | Yes | Yes |
| Source | Internal | External/Scripts |
Note: RuntimeUsers cannot access Engineering mode or modify solution configuration. They are application users only.
string error = await @Security.AddRuntimeUserAsync(
"username", // name
"Operator", // permissionsStr
"password", // password
"", // passwordHint
"Enhanced", // policyStr
"", // contactInfoEmail
"", // contactInfoPhone
"", // contactInfoCompleteName
false // oneTimePassword
); |
Configuration: Datasets → DBs → RuntimeUsers
Access: Security → RuntimeUsers (read-only view)
| Property | Description | Modifiable |
|---|---|---|
| Name | Unique username | Via script/DB |
| Password | Encrypted credential | Via script/DB |
| Permissions | Group assignments | Via script/DB |
| Policy | Security policy | Via script/DB |
| Blocked | Access denied flag | Via script/DB |
| Deleted | Soft delete marker | Via script/DB |
| InvalidAttempts | Failed login count | Auto-updated |
| ChangePasswordRequired | Force password change | Via script/DB |
| LastChangePasswordUTC_Ticks | Password change timestamp | Auto-updated |
| LastBlockedUserUTC_Ticks | Block timestamp | Auto-updated |
| Level | Hierarchical access | Via script/DB |
| Category | User classification | Via script/DB |
| ContactInfo | Email/phone | Via script/DB |
Location: <SolutionPath>.dbRuntimeUsers
Table automatically created with:
Protect the Runtime Users database. By default, the Runtime Users database is an unencrypted SQLite file in the solution folder, or in the Path set under Execution Environment in Runtime Startup. Anyone who can write to that folder can replace the file, and the users in the replacement file can log on. Move the Runtime Users database to a server database with its own logon, such as SQL Server with encryption turned on, in Datasets → DBs → RuntimeUsers. Restrict write access to the solution folder and that Path folder.
string error = await @Security.AddRuntimeUserAsync(
"username", // name
"Operator", // permissionsStr
"password", // password
"", // passwordHint
"Enhanced", // policyStr
"", // contactInfoEmail
"", // contactInfoPhone
"", // contactInfoCompleteName
false // oneTimePassword
); |
csharp
// Change password
@Security.ChangePassword("john.doe", "newPassword");
// Update permissions
@Security.SetUserPermissions("john.doe", "Operator,Supervisor");
// Block user
@Security.BlockUser("john.doe");csharp
// Soft delete (mark as deleted)
@Security.DeleteUser("john.doe", softDelete: true);
// Hard delete (remove from database)
@Security.DeleteUser("john.doe", softDelete: false);Automatic Availability when:
Configuration:
Connection Methods:
Rich Client:
Server: ServerName
Port: 3102 (AD port)
Windows Authentication: EnabledWeb Client URL:
http://server/fs-2024/TSmartClient.application?port1=3102&wa=trueSetup:
ldap://company.local:389
ldaps://secure.company.local:636Connection String Examples:
Standard LDAP:
ldap://dc1.company.local:389Secure LDAP:
ldaps://dc1.company.local:636With Base DN:
ldap://dc1.company.local:389/DC=company,DC=localUser Resolution Order:
Group Mapping Example:
Windows Group: Domain\Engineers
Permission Group: Engineering
Result: User gets Engineering permissionsLDAP Attributes Mapping:
| LDAP Attribute | Solution Property |
|---|---|
| sAMAccountName | UserName |
| memberOf | Permissions (via groups) |
| displayName | Display name |
| ContactInfo | |
| department | UserGroup |
Client.LogOn(username, password)
↓
1. Check Engineering Users (SecurityUsers)
2. Check Runtime Users (Database)
3. Check LDAP Server (if configured)
4. First valid match logs incsharp
// Get all active users
var users = @Security.GetActiveUsers();
// Check if RuntimeUser
bool isRuntimeUser = @Security.IsRuntimeUser(username);
// Get user source
string source = @Security.GetUserSource(username);
// Returns: "Internal", "Database", "AD"csharp
// Check if using Windows Authentication
if (@Client.IsWindowsAuthenticated)
{
string domain = @Client.WindowsDomain;
string user = @Client.WindowsUserName;
@Info.Trace($"AD User: {domain}\\{user}");
}csharp
// Configure service account for LDAP queries
@Security.LDAPServiceAccount = "svc_scada";
@Security.LDAPServicePassword = GetSecurePassword();
@Security.LDAPSearchBase = "OU=Users,DC=company,DC=local";AD Server: mfg.company.local
Port: 3102
Groups:
- MFG\Operators → Operator
- MFG\Engineers → Engineering
- MFG\Managers → SupervisorLDAP: ldaps://enterprise.local:636
Base DN: DC=enterprise,DC=local
Groups:
- CN=SCADA_Users → User
- CN=SCADA_Admin → AdministratorUser not found:
Cannot create user:
AD/LDAP users not working:
Wrong permissions:
Slow authentication: