Usersecurity::Authenticate

See Also ß


This is the main method used to authenticate a user. Depending on whether the authentication mode is set to use the internal file or NT Authentication this method returns .T. or .F. for success.

When using the internal user file mechanism, the oUser member of this object is set with all the fields of the current record from the user table. For example you can do the following:

oLogon = CREATE('UserSecurity')
IF !oLogon.Authenticate('rstrahl','mypassword')
    MessageBox(oLogOn.cErrorMsg)
ELSE
    MessageBox('Welcome ' + oLogon.oUser.FullName)
ENDIF

With NT Security the oUser structure is currently not loaded and returns NULL. In future versions the information may be pulled from Active Directory. When using NT Security it's recommended you call the AuthenticateNT method instead.

Syntax:

o.Authenticate(lcusername, lcpassword)
Return: .T. or .F.
Parameters: lcusername
The username to authenticate against

lcpassword
The password of the user to authenticate

Note: Username and password values are case insensitive!


Last Updated: 04/01/00