AVEVA OMI Software Developer Kit
AVEVA OMI Developer Guide > Assemblies (Component SDKs) > RunTimeData SDK > Security Namespace (Auto LogOn and LogOff)
Security Namespace (Auto LogOn and LogOff)

The Security namespace provides four attributes that you can use to implement auto logon and timed auto logout for the current Windows user when connecting to a ViewApp:

  • MyViewApp.Security.AutoLogonCurrentUser: Boolean value used to enable automatic login of currently-logged in Windows user. If disabled, the user has to log on to the ViewApp manually. Default value is TRUE (enabled). The value is retentive.
  • MyViewApp.Security.AutoLogoff: Boolean value used to enable automatic log off after a period of inactivity. Default value is OFF (disabled). The value is retentive.
  • MyViewApp.Security.AutoLogoutTimeSpan: Time value that sets the maximum period of user inactivity in seconds. Default initial value is 600. The value is retentive.
  • MyViewApp.Security.AutoLogoutTimeRemaining: Time value that counts down how many seconds of the AutoLogoutTimeSpan remains before AutoLogout occurs. Default initial value is 0.

Note that these four attributes are applicable to the automatic logon/logoff feature, and are in addition to other attributes in the security namespace used for monitoring the status of ViewApp users. 

Enable AutoLogon

Auto Logon requires that you have enabled either OS User or OS Group based security. When true, the AutoLogonCurrentUser attribute allows the currently-logged in Windows user to use the ViewApp without having to re-enter their credentials.

To enable auto logon for your ViewApp, create a button or similar graphic element. Then, add an animation, such as a Pushbutton or Action Script and reference the AutoLogonCurrentUser attribute, as follows:

MyViewApp.Security.AutoLogonCurrentUser

If you prefer scripting, you can use the LogonCurrentUser() method. 

Enable AutoLogOff

To enable AutoLogoff, set the attribute to TRUE (default value is FALSE). Like AutoLogonCurrentUser, AutoLogoff can be implemented via an animation in a button or other graphic element. Set the AutoLogoff to TRUE as follows:

MyViewApp.Security.AutoLogoff == true

Configure the two additional time attributes as animations as well. AutoLogoutTimeSpan has a default integer value of 600 (seconds). You can change this directly by editing the default value in the SystemTags.xml file. Use the AutoLogoutTimeRemaining attribute in a display animation to show the user how much time of inactivity is remaining before they are automatically logged off the ViewApp. Note that both time attributes should also be configured as integer values, not time or elapsed time values.

See Also

ViewApp Attributes