Implementing Auto Sign-On
The IAutoSignOn interface defines some of the core properties and methods used by hosted applications that require the automatic sign-on feature..
The following table defines the properties of the IAutoSignOn Interface. All of these properties can be initialized by using values from the database in the SetAutoSignOnInfo method of the IAutoSignOn interface.
|
Name |
Type |
Description |
|---|---|---|
|
IsLoggedIn |
Bool |
This returns the logon status of the hosted application. If the application is already signed in, the value is True; otherwise False. |
|
LoginFields |
LoginFieldRecord [] |
This property gets or sets the array of the logon credential field objects where each of these objects holds the details of one logon field of the hosted application |
|
EnableAutoSignOn |
Bool |
This returns whether the auto sign-on feature is enabled for the hosted application. If True, auto sign-on is enabled; otherwise it is False. |
The following table defines the methods of the IAutoSignOn interface.
|
Signature |
Description |
|---|---|
|
Void SetAutoSignOnInfo(LoginFieldRecord [] loginFields, bool enableAutoSignOn) |
This method sets values for the member variables that the applications require to implement auto sign-on. This method is called in the LoadApplications() function of the HostedAppLauncher class. It fetches the LoginFieldsRecord from the Web service, and passes the data to the hosted application that requires the data for auto sign-on. |
|
Void DoAutoSignOn() |
This method implements the functionality for signing into the hosted application. It calls instance () from the provider class, SignerProvider, which creates an instance of the provider class. This instance is based on the configuration data needed to perform the sign-in for the hosted application. |
The following table lists the supporting classes that are needed to implement the IAutoSignOn interface.
The LoginFieldRecord class is used to store data for the logon credential fields required by the hosted application.
LoginFieldRecord Properties
|
Name |
Type |
Description |
|---|---|---|
|
Label |
string |
This property sets or returns a Label assigned to the logon control. This allows the control to be recognized across platforms; for example, the Label assigned to the UserName control. |
|
AttributeIdentity |
string |
This property sets or returns the identity of the attribute, whether a Name, ID, or Value. It is used to identify the logon control (element) in the HTML logon page source code for Web applications. |
|
AttributeValue |
string |
This property sets or returns the value of the control’s attribute (specified by attributeIdentity) for the Web application logon page. |
|
ControlSequence |
string |
This property sets or returns the sequence of the desired logon control as an enumerated list of child controls in the hosted control and external application window. In the case of hosted Web applications, it holds a sequence of controls when the control is identified by the value or name attribute and when more than one control has the same attributeValue in an HTML document. |
|
Operation |
string |
This property will set or return the action to be performed on the logon control. The ready-made implementation supports two actions: Set and Click. Set populates the credentials in the input controls (such as text boxes), and Click performs the click operation for controls that use a click to change their state (such as buttons, check boxes, and so on.) |