SmDirLookup()

stmndr calls SmDirLookup() to look up a pattern in the directory.
casso1283
SiteMinder
calls SmDirLookup() to look up a pattern in the directory.
Use the following search expression grammar for the search pattern:
[[<class>]=][[<attribute>]=]<value>
In the search pattern format:
  • <class> = user | group | empty-string (empty-string implies user & group)
  • <attribute> = empty-string | string (name of LDAP attribute or ODBC column)
  • <value> = wildcarded-string
Your code must be able to interpret a search pattern that begins with the string user=. For example:
...
CStringArray Paths, Classes;
CString szPattern = CString ("user=") + UserDir.m_szUniversalIDAttr
   + CString ("=") + Session.m_szUnivId;
if (m_pDsDir->Lookup (szPattern, Paths, Classes))
....
SiteMinder
calls SmDirFreeStringArray() to free the
lpszDNs
and
lpszClasses
arrays.
Syntax
int SM_EXTERN SmDirLookup (
   const Sm_Api_Context_t*  lpApiContext,
   void*                    pHandle,
   void*                    pInstanceHandle,
   const char*              lpszPattern,
   char***                  lpszDNs,
   char***                  lpszClasses
);
Parameter
I/O
Description
lpApiContext
I
Pointer to the API context structure.
pHandle
I
The address of the pointer returned by SmDirInit().
pInstanceHandle
I
The address of a pointer to the directory instance handle.
lpszPattern
I
Buffer containing the pattern to search in the directory.
lpszDNs
O
List of user distinguished names that match the pattern.
lpszClasses
O
List of class information corresponding to the user distinguished names.
 
Returns
Returns 0 if successful or -1 if not successful.
Remarks
This function is called when you perform a user directory search.
Sample Code Information
When trying the sample code, go to the Administrative UI, navigate to the dialog box for the directory search, and enter the search criteria as follows:
  • In the Search drop-down list box, select User.
  • In the Search Expression field, enter the exact name of one of the sample users, such as Mikel. Do not use wild cards.