Repository navigation
workspace sdk logon providers
Logon providers customize how operators log on to Security Center client applications. They replace the default logon mechanism with a custom authentication flow, enabling integration with external identity systems.
Use logon providers when operators need to authenticate through a mechanism that Security Center does not natively support. Examples include:
- Authenticating with a smart card or hardware security token.
- Integrating with a corporate single sign-on (SSO) system.
- Implementing multi-factor authentication using a third-party service.
- The module registers a
LogonProviderwith the workspace duringLoad. - The system selects the provider with the highest
Priorityvalue. - When the logon dialog appears, the system calls
LogOn()on the provider. - The provider collects credentials from a UI, hardware, or an external system and calls
LogOnAsync()with aLogonInfoobject. - The provider raises the
Connectingevent to indicate authentication is in progress. -
LogOnAsync()returns aConnectionStateCodeindicating success or the reason for failure. - If the application enters idle mode due to inactivity, the system calls
LogOn()again. CheckIsIdleModeto handle reconnection differently.
Inherit from LogonProvider and implement the required members Name, UniqueId, and LogOn:
public class MyLogonProvider : LogonProvider
{
public override string Name => "My Logon Provider";
public override Guid UniqueId => new Guid("A1B2C3D4-E5F6-7890-ABCD-EF1234567890");
public override async void LogOn()
{
var logonInfo = new LogonInfo(m_server, m_username, m_password);
var result = await LogOnAsync(logonInfo);
if (result != ConnectionStateCode.Success)
{
// Handle logon failure
}
}
}| Member | Type | Description |
|---|---|---|
Name |
Property (abstract) | The logon provider's display name. |
UniqueId |
Property (abstract) | A stable GUID that uniquely identifies this logon provider. |
ConfigurationName |
Property (virtual) | The logon provider configuration name. Defaults to null. |
IsIdleMode |
Property | Whether the application is in idle mode due to operator inactivity. |
Priority |
Property (virtual) | Provider priority. Higher values take precedence. Defaults to 0. |
LogOn() |
Method (abstract) | Implement the logon mechanism. Collect credentials and call LogOnAsync with a LogonInfo object. |
LogOnAsync(LogonInfo, CancellationToken) |
Method (protected) | Perform the logon operation. Returns a ConnectionStateCode indicating the result. |
| Event | Description |
|---|---|
Canceled |
Raised when the operator cancels the logon operation. |
Connecting |
Raised when the logon operation is in progress. |
LogonInfo provides the credentials for a logon operation.
Create a LogonInfo with the server address and credentials:
// Log on with username and password
var info = new LogonInfo("server-address", "username", "password");
// Log on with a certificate
var info = new LogonInfo("server-address", "username", certificate);
// Log on with current Windows credentials
var info = new LogonInfo("server-address");| Member | Type | Description |
|---|---|---|
Server |
string | The server address for the connection. |
Username |
string | The username for authentication. |
Password |
string | The password for authentication. |
Certificate |
X509Certificate2 | The certificate for authentication. |
UseWindowsCredentials |
bool | Whether to log on using the current Windows credentials. |
RetryCount |
int | Number of connection retries. Defaults to -1 (no retry limit). |
SupervisorName |
string | The supervisor's username for supervised operations. |
SupervisorPassword |
string | The supervisor's password for supervised operations. |
The LogOnAsync method returns a ConnectionStateCode indicating the result:
| Value | Description |
|---|---|
Success |
Connection was successful. |
InvalidCredential |
Invalid credentials were provided. |
InsufficientPrivileges |
The operator does not have sufficient privileges. |
Timeout |
The connection timed out. |
LicenseError |
A license error prevented the connection. |
PasswordExpired |
The password has expired. |
UserAccountDisabledOrLocked |
The operator account is disabled or locked. |
LogonAborted |
The operator aborted the logon. |
Failed |
The connection failed. |
Note
Logon providers do not require an SDK certificate.
Register the provider in your module's Load method:
public class SampleModule : Module
{
private MyLogonProvider m_logonProvider;
public override void Load()
{
m_logonProvider = new MyLogonProvider();
m_logonProvider.Initialize(Workspace);
Workspace.Components.Register(m_logonProvider);
}
public override void Unload()
{
if (m_logonProvider != null)
{
Workspace.Components.Unregister(m_logonProvider);
m_logonProvider.Dispose();
}
}
}Important
LogonProvider implements IDisposable. Call Dispose when unregistering the provider to release resources.
- About the Workspace SDK: Workspace SDK architecture and module lifecycle.
- About components: The component registry and registration lifecycle.
- About Workspace SDK certificates: Certificate requirements for workspace components.
- About workspace modules: Workspace module class and Load/Unload lifecycle.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting