SecureLogin Lotus Notes script does not detect Force Password Change dialog

  • 3058382
  • 15-May-2007
  • 26-Apr-2012

Environment

Novell SecureLogin
NSL v 6.0.x
Application Definition Scripting
Microsoft Windows 2003
Lotus Notes v 6.5 (other versions not tested)

Situation

On Windows 2003, the Lotus Notes script for Novell SecureLogin will sometimes not behave properly with regard to detecting password changes. Specifically, the Force Password Change dialog is not detected when the user's Lotus Notes password is expired.

Resolution

Windows 2003 has different controls, which causes the shipping script to not work properly. The following script can be used to overcome this problem.

#=============================================================
# EXE/ID: NLNOTES.EXE
# Name: Lotus Notes R6.5
# Type: Windows
# App Version:
# Script Version: 1.0
#
# Written By: ActivIdentity
# Last Updated By: ActivIdentity
#
# History:
#
# 10 November 2005 - ActivIdentity - Created application definition
#=============================================================

#=====================================
# Enforce Lotus Notes Password Policy
#=====================================
#RestrictVariable ?NewNotesPwd LotusNotesPwdPolicy

#=========================================================
# Password change warning box has been found.
# Ask the user if they would like to change their password now.
# If yes, it will change, if no, it won't.
#=========================================================
Dialog
Title "Lotus Notes"
Ctrl #65535 "WARNING: Your password will expire on (.*)"
EndDialog

Click #7
MessageBox "Your password for Lotus Notes will soon expire. If you choose Yes, next time you go to your Inbox, your password will be changed automatically and remembered by SecureLogin. If you choose No, this message will be displayed everytime Notes starts." -YesNo ?Result

If ?Result Eq "Yes"
Set ?PassChangeFlag "On"
EndIf

#=========================================================
# Password expiry warning box has been found.
# So problems don't occur, force the password change.
#=========================================================
Dialog
Title "Lotus Notes"
Ctrl #65535 "You must change your password. It expired on(.*)"
EndDialog
Set ?PassChangeFlag "On"
Click #7
MessageBox "Your Lotus Notes Password has expired! For security and operational reasons, next time you go to your Inbox, it will be changed automatically and remembered by SecureLogin."


#===============================================================
# This is the start of Lotus Notes and the workspace is now up and ready to
# accept the ALT keyboard commands.
#===============================================================
Dialog
Parent
Class "FramesetSubprog"
EndParent
Class "NotesTabSpacer"
EndDialog

#======================================================================
# If ?PassChangeFlag is "On", select File, Security, User Security, Set Password.
#======================================================================
If ?PassChangeFlag Eq "On"
MessageBox "For security and operational reasons, Lotus Notes is about to change your password. Your password will be automatically updated for you. Click OK to clear this message and the process will begin. It will advise you when the password has been changed and you can then continue to work as normal...."
Delay 1000
Type "\Alt+F"
Type "Y"
Type "S"

EndIf

Dialog
Title "User Security"
EndDialog
If ?PassChangeFlag Eq "On"
Type "\Alt+P"
Endif

#=====================================================================
# This is a Notes Error where the password selected cannot be re-used.
# We must reset the password prompt count so we don't save the wrong password
# when the password prompt box is redisplayed
#=====================================================================
Dialog
Title "Lotus Notes"
Ctrl #65535 "You have used this password before. Please choose a new one"
EndDialog

ReadText #65535 ?Message
Click #2
MessageBox ?Message
Delay 100
Type -Raw "\ALT-P"

#==================================================================================
# This is a Notes Error where the password selected does not match the server password policy.
# We must reset the password prompt count so we don't save the wrong password
# when the password prompt box is redisplayed
#==================================================================================
Dialog
Title "Lotus Notes"
Ctrl #65535 "The password you specified is not complex enough."
EndDialog

ReadText #65535 ?Message
Click #2
MessageBox ?Message
Delay 1000
ChangePassword ?NewNotesPwd
Type -Raw ?NewNotesPwd
Delay 300
Type -Raw "\T"
Delay 300
Type -Raw ?NewNotesPwd
Type -Raw "\N"

#===========================================================================
# The ChangePassword box has been displayed by the user or because of manual
# password invokation.
#===========================================================================
Dialog
Title "Change Password"
Ctrl #280
Ctrl #283
Ctrl #2185 "&Enter new password"
EndDialog

ChangePassword ?NewNotesPwd
Type ?NewNotesPwd #280
Delay 50
Type ?NewNotesPwd #283
Click #1

#===================================================
# On a successful password change message update the
# password variable
#===================================================
Dialog
Title "Lotus Notes"
Class #32770
Ctrl #65535 "Your password change succeeded!"
EndDialog

Click #2
MessageBox "Password change successful. SecureLogin will remember your password for you."

#====================================================
# Record the newly set password and set the password change flag off
#====================================================
Set ?PassChangeFlag "Off"
Set $Password ?NewNotesPwd

#==================================
# Main Notes Password Prompt
#==================================
Dialog
Title "Lotus Notes"
Class #32770
Ctrl #280
Ctrl #224
EndDialog

If -Exists $Username
Else
ReadText #224 $Username
If $Username Eq ""
ReadText #218 $Username
EndIf
EndIf

SetPrompt "Notes Password ===>"
Type $Password #280
Click #1

SetPrompt "Please enter your correct Lotus Notes password."

#=========================================================
# We have the wrong password in the database for this application.
#=========================================================
Dialog
Title "Lotus Notes"
Ctrl #65535 "Wrong password(.*)"
EndDialog

#=============================================
# Clear wrong password error (Lotus Notes owned)
#=============================================
Click #1

DisplayVariables "The password stored in Single Sign-on does not match the user password in the Notes ID file. Please enter the correct Lotus Notes password." $Password
SetPrompt "Notes Password:"
Type -Raw $Password
Type -Raw "\N"

#==============================================
# Subroutine to handle cancelled password changes
#==============================================
Sub ClearPasswordChange
MessageBox "You have cancelled the password change operation! You will have to set a new password in the near future or you may have problems accessing the system."
Type -Raw "\|27"
ClearException ChangePasswordCancelled
EndScript
EndSub