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.
csharp
// Create user programmatically
@Security.CreateUser(
"john.doe",
"password123",
"Operator,Maintenance",
"Enhanced"
);
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:
csharp
public void CreateOperator(string username, string password)
{
bool success = @Security.CreateUser(
username,
password,
"Operator", // Permissions
"Default" // Policy
);
if (success)
{
@Info.Trace($"User {username} created");
}
}
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: Enabled
Web Client URL:
http://server/fs-2024/TSmartClient.application?port1=3102&wa=true
Setup:
ldap://company.local:389
ldaps://secure.company.local:636
Connection String Examples:
Standard LDAP:
ldap://dc1.company.local:389
Secure LDAP:
ldaps://dc1.company.local:636
With Base DN:
ldap://dc1.company.local:389/DC=company,DC=local
User Resolution Order:
Group Mapping Example:
Windows Group: Domain\Engineers
Permission Group: Engineering
Result: User gets Engineering permissions
LDAP 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 in
csharp
// 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 → Supervisor
LDAP: ldaps://enterprise.local:636
Base DN: DC=enterprise,DC=local
Groups:
- CN=SCADA_Users → User
- CN=SCADA_Admin → Administrator
User not found:
Cannot create user:
AD/LDAP users not working:
Wrong permissions:
Slow authentication: