How to integrate ?

How to connect my .Net Application to VG Identity Server

Estimated reading: 6 minutes 75 views

Integrating WinConsole with an Identity Server enables centralized and secure authentication across your application environment. Instead of managing user credentials locally, WinConsole can rely on the Identity Server to handle login, token generation, and access control using modern authentication protocols such as OAuth2 and OpenID Connect. This integration not only enhances security by enforcing consistent authentication policies, but also simplifies user management, supports single sign-on (SSO), and improves the overall user experience. In this article, we will walk through the key concepts and steps required to successfully connect WinConsole with an Identity Server.


How this integration will benefit you

  • Centralized Management via WinConsole – All configurations, user access, and updates are handled directly from WinConsole, giving administrators a single place to manage everything.
  • Secure Authentication with VG Identity Server – Authentication is managed by VG Identity Server in the background, ensuring a secure and standardized login process.
  • Real-Time Synchronization – Any changes made in WinConsole (users, roles, permissions) are immediately reflected during authentication without additional setup.
  • No Need to Use Identity Server Separately – Administrators don’t have to manage settings in multiple places, which reduces effort and avoids duplication.
  • Works Seamlessly in the Background – VG Identity Server integrates smoothly without impacting existing workflows, while WinConsole remains the main control point.
  • Consistent Access Control – Permissions defined in WinConsole are applied accurately during runtime, ensuring users only access what they are allowed to.
  • Simplified Administration – Managing users and permissions becomes quicker and easier without switching between systems.
  • Better Visibility and Control – All user access and configuration details are available in WinConsole, making monitoring and management more straightforward.

How to Integrate Winconsole with VG Identity Server

Step 1: Create Repository: Create a new repository in Win Console if it does not already exist.


Step 2: Request and Download License: Click on Request License, fill in the required details, and submit the request. After approval, you will receive an email notification. You can then download the license from the Repository Information page and store it securely


Step 3: Create a Windows Application

If you already have an existing Windows application, you can use it for this integration. Otherwise, create a sample Windows Forms application to verify that the integration works correctly.

Design a simple user interface for the application. Add two buttons to the form:

  • Create – to create a new instance
  • Delete – to delete an existing instance

These buttons will be used to perform and test the required operations.


Step 4: Add Required Visual Guard Assemblies

Add the required assemblies to the project to enable integration with Visual Guard Identity Server.

  • Open the solution in Visual Studio and locate the target project in Solution Explorer.
  • Right-click the project node and select Manage NuGet Packages, then search for Novalys.
  • Install the following packages:
    • Novalys.VisualGuard.Security
    • Novalys.VisualGuard.Security.NetFramework
    • Novalys.VisualGuard.Security.WinForm
    • Novalys.VisualGuard.Security.VGIdentityServerClient
    • VisualGuard.Common.Net.DependencyTemplate (required for .NET 6/7/8 projects)

Ensure that all required dependencies are successfully installed and restored before proceeding with the integration.


Step 5: Integrate VG Runtime: Ensure that the Visual Guard Runtime (VGRuntime) is properly integrated into the application before proceeding. The VGRuntime establishes the connection with the VG Identity Server using the URL specified in the Visual Guard configuration files.

Below image, shows the code to show Login form for the user to Authenticate on Windows application created in Step 3

  • C#
static void Main()
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    using (VGLoginForm vgForm = new VGLoginForm())
    {
        DialogResult result = vgForm.ShowDialog();
        if (result == DialogResult.OK)
        {                    
            Application.Run(new Form1());
        }
    }
}

Step 6: Add your Application in Winconsole: Ensure that the application is properly linked to the repository so that it can utilize the configured permissions, roles, and authentication settings.

To add the application in Win Console:

  • Right click on the repository –> Select new application
  • Select the type of application –> Next
  • Select ‘Visual Guard runtime is already integrated’ –> Next
  • Provide assembly path and Add the script language –> Next
  • Browse through the advanced options for the application –> Click on Finish to complete the setup wizard

Step 7: Configure Permission, Roles and User: Define and configure the required permissions (e.g., Create, Delete) in WinConsole to represent the actions that can be performed in the application.


Step 9: Configure IIS and Install VG Identiy Server


Step 10: Configure VG Identity Server and Winconsole: Configure VG Identity Server and WinConsole to establish secure communication between the application and the authentication system. Ensure that the Identity Server URL and related settings are correctly defined in the Visual Guard configuration so that VGRuntime can connect seamlessly.

Verify that WinConsole is properly linked with the configured Identity Server and repository, allowing it to manage users, roles, and permissions while delegating authentication to the Identity Server.

  • Right-click on your application → Generate configuration file.
  • Enable ‘Switch to database connection’.
  • Enter Identity Server URL. (Shown in below image)
  • Overwrite configuration file and verify URL mapping.

This action will generate new VG configuration files for the application and points to the identity server URL for the application.


Step 11: Testing: The Application’s Visual Guard configuration file should be reviewed as part of the testing and validation process to ensure that the application is correctly configured for the intended integration scenario.

Configuration Scenarios: The configuration may vary depending on the type of integration implemented within the application:

Database Integration
If the application is configured to connect directly to a database, the configuration settings should align with the structure illustrated in below image. This typically includes database connection parameters and related access settings.

Identity Server Integration
If the application is integrated with the Identity Server, the configuration settings should correspond to image shown below. This includes parameters required for authentication, authorization, and communication with the Identity Server.

Reviewing these configurations ensures that the application is properly set up and supports successful execution of authentication and authorization workflows during testing.

Note: After completing all the above steps, you can confirm the successful integration by reviewing the VisualGuardConfiguration.config file. The configuration should reflect the Identity Server integration as illustrated in the screenshot above. This file will be in assembly path provided in Step 6 (Provide assembly path and Add the script language)