CreateUserLDAPAuthenticated

Description

Creates a HCL Compass user account with LDAP authentication. Sets the new user account AuthenticationMode as LDAP_AUTHENTICATION.

This method takes two arguments:
  • An LDAP user login name (LDAP_login_name)
  • A HCL Compass user profile name (CQ_user_name)

The CreateUserLDAPAuthenticated method copies an LDAP attribute value from the LDAP user account to the user profile field to map an LDAP user name to a HCL Compass user name.

The method first checks the schema repository to ensure that the there is no conflict with another active LDAP enabled user's CQLDAPMap field value to ensure that the values are unique across active LDAP enabled users.
Note: The HCL Compass user profile field that is used for correlating LDAP user records to HCL Compass user records is the CQLDAPMap field.

If CQ_LOGIN_NAME is configured as the mapping field (using the installutil setcqldapmap subcommand to specify which HCL Compass user profile field is used to correlate LDAP and HCL Compass user accounts), the CQ_user_name parameter must be identical to LDAP_login_name or set to a Null string.

Note: The caller of this method must have Administrator privileges to call this method (that is, the UserPrivilegeMaskType value, USER_ADMIN).
Errors occur if:
  • The caller of the method does not have Administrator privileges to perform this operation
  • The LDAP user account (LDAP_login_name) cannot be found
  • There is a conflicting HCL Compass user account (CQ_user_name) of the same name
  • The value of the LDAP attribute used to map an LDAP to a HCL Compass user is not retrieved
  • CQ_LOGIN_NAME is configured as the mapping field but the CQ_user_name parameter is not identical to LDAP_login_name or set to a Null string.
  • The LDAP attribute to be placed into the CQLDAPMap field conflicts with an existing, enabled LDAP CQLDAPMap field value.
Note: This method became available in version 2003.06.14.

Syntax

VBScript


adminSession.CreateUserLDAPAuthenticated(LDAP_login_name, CQ_user_name) 

Perl


$adminSession->CreateUserLDAPAuthenticated(LDAP_login_name, CQ_user_name); 
Identifier
Description
adminSession
The AdminSession object representing the current schema repository access session.
LDAP_login_name
A String containing the user login name for LDAP authentication (for example, myUniqueName@hcl.com).
CQ_user_name
A String containing the HCL Compass user profile name that will be stored in the HCL Compass database. It must not match any existing Compass user account names.
Return value
None on success, else an exception.

Examples

VBScript

' Create a HCL Compass admin session
set adminSession = CreateObject(("ClearQuest.AdminSession")
' Logon as admin 
adminSession.Logon "admin", "admin", ""
' Create an LDAP authenticated user
Dim cquser2 ' a user object 
Dim ldap_login 
Dim cq_username 
Dim mode 
' the user authentication mode 
ldap_login = "myusername@us.hcl.com" 
cq_username = "myusername" 
StdOut "Creating LDAP authenticated user " & ldap_name & vbCrLf 
Set cquser2 = admin_session.CreateUserLDAPAuthenticated(ldap_login, cq_username)
' verify the user authentication mode: 
StdOut "Getting authentication mode for user " & cquser2.name & vbCrLf 
mode = cquser2.GetAuthenticationMode 
StdOut "user mode: " & CStr(mode) & vbCrLf 

Perl

use CQPerlExt; 
# Create a HCL Compass admin session 
$adminSession= CQAdminSession::Build(); 
#Logon as admin 
$adminSession->Logon( "admin", "admin", "" ); 
 my $ldap_login = "myusername@us.hcl.com";
my $cq_username = "myusername"; 
my $newUserObj; 
$newUserObj = $adminSession->CreateUserLDAPAuthenticated($ldap_login, $cq_username);
# ... 
CQAdminSession::Unbuild($adminSession);