SetPlat

Item Description

Use with:

All

SecureLogin Version:

All

Type:

Action

Usage 1:

Usage 2:

SetPlat Application-Name

SetPlat RegEx Variable #Ctrl-ID

Arguments:

Application-Name

RegEx

Variable

#Ctrl-ID

The application name that the variables are read from.

A regular expression to be used as the application name.

Must be a ?Variable previously set (for example, using a pick list).

The control ID of the regular expression to be used.

For information on regular expressions, see http://msdn.microsoft.com/library/en-us/vcsample98/html/vcsmpspy.asp?frame=truehttp://etext.lib.virginia.edu/helpsheets/regex.html.

Description:

By default, variables are stored directly against the platform or application that you have enabled for single sign-on. For example, if you enable Groupwise.exe, the Groupwise® credentials are stored against the Groupwise.exe application.

You might have multiple accounts (for example, your own login and an Admin login) accessing the same application. Or you might have multiple applications using a common set of credentials. In these cases, SetPlat sets the application that the variables are read to and saved from.

You can also use SetPlat to do the following:

  • Script application1 to read its $Username and $Password from application2.

    This saves a user entering the credentials twice and having to remember to update them in both locations when the credentials change.

  • Script application1, application2, and application3 to read their credentials from Platform "Common."

    This means that you have a single store of common information that only needs to be updated once.

  • Create new applications, depending on what a user selected in a pick list.

    If the Application-Name doesn't exist, it will be created.

SetPlat can also read from a #Ctrl-ID and support regular expressions.

Example 1:
Windows Script
SecureLogin displays a pick list and sets a new user ID so that multiple users can log in to the application. In this case, SetPlat creates a new use ID called Default User, Global Administrator, or Regional Administrator. The respective $Username and Password are saved there.

# Login Dialog Box 
Dialog
Class #32770
Title "Login"
EndDialog
PickListAdd "Default User" 
PickListAdd "Global Administrator"
PickListAdd "Regional Administrator"
PickListDisplay ?Choice "Select the account to use." -NoEdit
SetPlat ?Choice 
Type $Username #1001
Type $Password #1002
Click #3


Example 2:
Web Script

The following figure illustrates a standard dialog box for accessing a password-protected site using Netscape Navigator.


A dialog box for accessing a password-protected Web site

When you specify the Title, Class, Username, and Password fields of this dialog box, they will always be the same. If you stored the Username and Password against this application without using the SetPlat command, the Username and Password for www.novell.com would be entered to log in to any site (and are invalid for any other site).

However, the dialog box pictured above always contains the name of the Web site to log in to. This can be used as the unique identifier, to set a new SecureLogin platform, and save login credentials to.

The solution to this problem is to use a dialog block with a SetPlat statement similar to the following:

Dialog 
Title "Username and Password Required"
Ctrl #330
Ctrl #214
Ctrl #331
Ctrl #1
Ctrl #2
Setplat #331 "Enter username for .* at (.*):"
EndDialog
Type $Username #214 
Type $Password #330
Click #1

The power of this script is in the following line:

Setplat #331 "Enter username for .* at (.*):"

The script first reads the following line from dialog control ID 331:

Enter username for Control Panel at www.novell.com:

The script then applies the regular expression to this text. Regular expressions are a powerful way to manipulate text strings. However, for most purposes you can use the basic commands listed in the following table:

Basic Command Action

* (an asterisk)

Matches any character

. (a period)

Matches zero or more of the preceding character

( ) (parentheses)

Makes the contents of the parentheses a subexpression

After running the script, the user sees the username and password saved as www.novell.com.


Variables and values in a login

The text that is matched inside the parentheses then becomes the symbol application. If a dialog #Ctrl-ID is not specified, the symbol application is unconditionally changed to the application specified in the RegEx. An unconditional SetPlat command is only valid if specified before Dialog/EndDialog statements.