ContentsIndexPreviousNext

8.4.1 Passwords

When a password is assigned to an entry in the server access file, requesters who match that entry must return a matching password to AcuServer. The client application has two options for acquiring and sending a password back to AcuServer.

Option one: program variable

The requesting application may include code which checks for the program variable Acu-Client-Password. If defined, its value is considered an unencrypted password which is then encrypted and sent to AcuServer for verification. If the value does not match the value in the access record, the connection is refused. Using Acu-Client-Password, the COBOL programmer has a great deal of flexibility in setting and acquiring the password. Using Acu-Client-Password, the programmer can supply a password to AcuServer without requiring any user interaction (the user may remain unaware that a password is required).

To use Acu-Client-Password, declare an external pic X variable named Acu-Client-Password in Working-Storage.

ACU-CLIENT-PASSWORD PIC  X(8) IS EXTERNAL

Assign (move) a value to the variable before the program's first access to a remote file (or better, before the program's first access to any file).

Option two: user-entered password

If Acu-Client-Password is not defined, the client runtime will open a dialog window requesting that the user enter a password.

A password is required to connect to host hostname.
Please enter a password:

The user must enter a password. The characters do not echo on the screen.

The password is then encrypted and sent to the server for verification. If the password matches, a connection is established. If the password doesn't match, the user is prompted again to enter a password.

Invalid password
Please enter a password:

The password verification cycle is repeated until a valid password is entered, or the value of the server configuration variable PASSWORD-ATTEMPTS is exceeded (the default value is three).

The text displayed by the runtime to prompt for a password and report a failed verification can be modified with the TEXT runtime configuration variable (see Section 6.1.1 Runtime Configuration Variables).