Sun Java System Calendar Server 6 2005Q4 Developer's Guide

API: csIAuthentication

All plug-ins wanting to augment or override the default authentication behavior of the calendar server must implement this interface.

Methods

The csIAuthentication interface implements five methods:

Method: ChangePassword

Change a user’s password. 

Method: Init

Confirms that the interface was found and registered. 

Method: Logon

Logs in a user. 

Method: Logout

Logs out a user. 

Method: VerifyUserExists

Verify a user’s existence. 

Description

Allows you to define logon, logoff, verification, and password methods that implement the authentication technique of your choice. You can replace a method and still continue to use the default for the others. Each method uses the return code parameter (aReturnCode) to tell the server whether to continue with the default access control process after executing the method. The return code value must be one of the following constants:

NS_CONTINUE_DEFAULT_PROCESSING

Indicates that the server is to continue default access control processing. 

NS_OVERRIDE_DEFAULT_PROCESSING

Indicates that this method overrides the server's native access control mechanism. 

Method: ChangePassword

Purpose

Changes the password for the specified user.

Syntax

PRUint32 Init (char* aUser, 
               char* aOldPassword, 
               char* aNewPassword, 
               PRInt32 *aReturnCode)=0;

Parameters

The method has the following four parameters:

aUser

The user’s name. 

aOldPassword

The old password. 

aNewPassword

The new password. 

aReturnCode

On return, contains a constant that determines whether the server should continue with the default authentication procedure. 

One of the following constants: 

  • NS_CONTINUE_DEFAULT_PROCESSING

  • NS_OVERRIDE_DEFAULT_PROCESSING

Returns

On success, NS_AUTHENTICATION_CHANGEPASSWORD_SUCCESS.

On failure, NS_AUTHENTICATION_CHANGEPASSWORD_FAILURE.

Description

Changes the password of the specified user.

Method: Init

Purpose

Confirms that the interface has been registered, and provides a reference to the server.

Syntax

PRUint32 Init (nsISupports *aServer)=0;

Parameters

The method has the following parameter:

aServer

On return, this location contains a reference to the server with which the module is registered. 

Returns

NS_OK on success. A non-zero code on failure.

Description

The server calls this method after finding and registering the interface on module load, to confirm that the operation was successful. You can use the pointer returned in aServer to make calls out to the server.

Method: Logon

Purpose

Augment or override the authentication procedure for plain text login.

Syntax

PRUint32 Login (char* aUser, char* aPassword, PRInt32 *aReturnCode)=0;

Parameters

The method has the following three parameters:

aUser

The user’s login name. 

aPassword

The plain text password. 

aReturnCode

On return, contains a constant that determines whether the server should continue with the default authentication procedure. 

One of the following constants: 

  • NS_CONTINUE_DEFAULT_PROCESSING

  • NS_OVERRIDE_DEFAULT_PROCESSING

Returns

On success, NS_AUTHENTICATION_LOGON_SUCCESS.

On failure, NS_AUTHENTICATION_LOGON_FAILURE.

Description

Use this method to specify your own authentication procedure on login to Calendar Server. You can augment the native authentication mechanism, performing your own processing first, then continuing with the default process, or you can completely replace the native authentication mechanism

Method: Logout

Purpose

Logout a user.

Syntax

PRUint32 Init (char* aUser,PRInt32 *aReturnCode)=0;

Parameters

The method has the following two parameters:

aUser

The user ID of the user to be logged out. 

aReturnCode

On return, contains a constant that determines whether the server should continue with the default authentication procedure. 

One of the following constants: 

  • NS_CONTINUE_DEFAULT_PROCESSING

  • NS_OVERRIDE_DEFAULT_PROCESSING

Returns

NS_OK on success. A non-zero error code on failure.

Description

None.

Method: VerifyUserExists

Purpose

Verify that the user ID is in the LDAP directory.

Syntax

PRUint32 Init (char* aUser,PRInt32 *aReturnCode)=0;

Parameters

The method has the following two parameters:

aUser

The user ID of the user to be logged out. 

aReturnCode

On return, contains a constant that determines whether the server should continue with the default authentication procedure. 

One of the following constants: 

  • NS_CONTINUE_DEFAULT_PROCESSING

  • NS_OVERRIDE_DEFAULT_PROCESSING

Returns

NS_OK on success. A non-zero error code on failure.

Description

None.