Authenticate Method  
 

Authenticate the client and assign access rights for the session.

Syntax

object.Authenticate( ClientId, [AccessFlags] )

Parameters

ClientId
An integer that identifies the client session.
AccessFlags
An optional integer value which specifies the access clients will be given when authenticated as this user. This value created from one or more bitflags. For a list of user access permissions, see User and File Access Constants. If this parameter is omitted, the client is authenticated using the default access permissions based on the server configuration.

Return Value

A value of zero is returned if the client session was authenticated. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

Remarks

The Authenticate method is used to authenticate a specific client session, typically in response to an OnAuthenticate event that indicates a client has provided authentication credentials as part of the request for a document or other resource.

To enable the server to automatically authenticate a client session, use the AddUser method to add one or more virtual users. The server will search the list of virtual users for a match to the credentials provided by the client and will set the appropriate permissions for the session without requiring a event handler to manually authenticate the session using this method.

If the server was started with the LocalUser property set to True and the client session is not authenticated using this method, the server will attempt to authenticate the client session using the local Windows user database. Although this option can be convenient because it does not require the implementation of an event handler for the OnAuthenticate event, it can be used by clients to attempt to discover valid usernames and passwords for the local system. It is recommended that you use the AddUser method to create virtual users rather than using the local user database.

See Also

MultiUser Property, Restricted Property, AddUser Method, DeleteUser Method, OnAuthenticate Event