.NET Integration
Introduction
A .NET component is available to simplify the process of integrating the SSO features into a .NET application.
Download SSO Client SDK
Download SSO Demo
NOTE: More complete documentation will be added over time. For now, refer to the Client SDK and SSO Demo downloads for technical details and examples.
NOTE: One aspect of the SDK that is likely to change in the near future is error handling and exception generation. There is little error handling in the current implementation, and no SDK specific exceptions are raised.
The SSO component uses the namespace ClearGage.SSO. A class named SsoHelper provides the entry point.
See the following sections for information on implementing specific SSO features:
Component Initialization
The code examples below are not setting a global "using" directive to avoid potential conflict with other similarly named classes that may exist in the primary application (i.e. Patient, Encounter, etc.).
Where applicable, change the code examples below to use the component names present in your application, or authentication parameters provided to you by ClearGage.
public class MyApplication
{
private ClearGage.SSO.SsoHelper ssoHelper;
public static void Main()
{
this.ssoHelper = new ClearGage.SSO.SsoHelper(
clientId: "S3D72C33",
username: "ssousername",
password: "ssopassword",
key: "N4PTzeuOOpZa",
name: "Test User"
);
}
}
By default, the component will make requests to the Production server environment. To make requests against the Demo server, add the following line of code after the component has been initialized:
this.ssoHelper.SetMode(SsoHelper.Mode.MODE_DEMO);
The component assumes you have a System.Windows.Forms.WebBrowser control available to display the hosted UI dialogs. Add the following line of code to enable the WebBrowser control to receive scripting commmands:
webBrowser1.ObjectForScripting = this.ssoHelper;
NOTE: The ability to create a WebBrowser control dynamically will be added to the component in the near future.
The WebBrowser control width and height can be passed into each method that displays a hosted UI dialog. Add the following lines of code to set the default width and height for your control so they do not need to be passed to each method call:
this.ssoHelper.DefaultDialogWidth = webBrowser1.Width; this.ssoHelper.DefaultDialogHeight = webBrowser1.Height;