Sun logo      Previous      Contents      Index      Next     

Sun ONE Calendar Server 6.0 Programmer's Manual

Chapter 4
Proxy Authentication SDK Reference

This chapter describes the Calendar Server Proxy Authentication SDK (authSDK) API. The chapter is divided into two parts: Proxy Authentication SDK Functions, and How to Use the authSDK.


Proxy Authentication SDK Functions

There are five authSDK functions. They are presented below in alphabetical order, not in order of use:


CEXP_GenerateLoginURL

Purpose

Returns a login URL with a valid session ID for a given user.

Syntax

int CEXP_GenerateLoginURL (char * pszUser,
                           char * pszClientAddress,
                           char * pszCalendarHost,
                           char * pszURL);

Parameters

There are four parameters:

pszUser

A string containing the user name.

pszClientAddress

A string containing the client host IP-address.

pszCalendarHost

A string containing the hostname (no IP-address) of the calendar server.

pszURL

A pointer to a buffer to place the URL

Returns

Returns 0 on success, -1 on failure. On success, the pszURL buffer contains a valid URL string.


CEXP_GetVersion

Purpose

Gets the version ID string.

Syntax

char * CEXP_GetVersion(void);

Parameters

There are no parameters:

Returns

A reference to the version ID string.


CEXP_Init

Purpose

Initializes the SDK.

Syntax

int CEXP_Init (char * pszLdapHost,
               char * pszLdapMatchAttrib,
               char * pszLdapDN,
               unsigned int iLdapPort,
               char * pszLdapBindUser,
               char * pszLdapBindPass,
               char * pszAdminUser,
               char * pszAdminPassword);

Parameters

There are eight parameters:

pszLdapHost

A string containing the hostname of the directory server.

pszLdapMatchAttrib

A string containing the attribute name. Used to match against the user name.

pszLdapDN

A string containing the base DN to search for user records. “DN”, for Distinguished Name, is a string representation of an LDAP directory entry’s name and location.

iLdapPort

An integer specifying the directory server’s port number.

pszLdapBindUser

A string specifying the DN to bind as.

pszLdapBindPass

A string containing the password for the bind DN.

pszAdminUser

A string containing the Sun ONE Calendar Server administrator’s LDAP user ID.

pszAdminPassword

A string containing the Sun ONE Calendar Server administrator’s password.

Returns

Returns 0 on success, -1 on failure.

Comment

If the bind DN (pszLdapBindUser) and password (pszLdapBindPass) are NULL, anonymous searching will be attempted.


CEXP_SetHttpPort

Purpose

Sets the HTTP port used to contact the calendar server.

Syntax

void CEXP_SetHttpPort (int iHttpPort);

Parameters

There is one parameter:

iHttpPort

An integer specifying the port.

Returns

Nothing.


CEXP_Shutdown

Purpose

Cleans up all global memory, shuts down connections, and other clean-up functions when the user is finished using the SDK.

Syntax

int CEXP_Shutdown (void);

Parameters

There are no parameters:

Returns

Returns 0 on success, -1 on failure.

Comments

Call this only after all threads using the SDK complete.


How to Use the authSDK

To implement authSDK in your installation, follow these steps:

  1. Link the authSDK to your code.
  1. Authenticate your user with your portal authentication program.
  2. Call CEXP_Init.
  1. Optionally, call CEXP_SetHttpPort.
  1. Optionally, call CEXP_Shutdown.

Other Tips

There are a few other things that must be done to assure success in using the AuthSDK:



Previous      Contents      Index      Next     


Copyright 2003 Sun Microsystems, Inc. All rights reserved.