CreateUserLDAPAuthenticated
Description
Creates a Rational® ClearQuest® user account with LDAP authentication. Sets the new user account AuthenticationMode as LDAP_AUTHENTICATION.
- An LDAP user login name (LDAP_login_name)
- A Rational ClearQuest 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 Rational ClearQuest user name.
If CQ_LOGIN_NAME is configured as the mapping field (using the installutil setcqldapmap subcommand to specify which Rational ClearQuest user profile field is used to correlate LDAP and Rational ClearQuest user accounts), the CQ_user_name parameter must be identical to LDAP_login_name or set to a Null string.
- 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 Rational ClearQuest user account (CQ_user_name) of the same name
- The value of the LDAP attribute used to map an LDAP to a Rational ClearQuest 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.
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@ibm.com).
- CQ_user_name
- A String containing the Rational ClearQuest user profile name that will be stored in the Rational ClearQuest database. It must not match any existing ClearQuest user account names.
- Return value
- None on success, else an exception.
Examples
VBScript
' Create a Rational
ClearQuest 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.ibm.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 Rational
ClearQuest admin session
$adminSession= CQAdminSession::Build();
#Logon as admin
$adminSession->Logon( "admin", "admin", "" );
my $ldap_login = "myusername@us.ibm.com";
my $cq_username = "myusername";
my $newUserObj;
$newUserObj = $adminSession->CreateUserLDAPAuthenticated($ldap_login, $cq_username);
# ...
CQAdminSession::Unbuild($adminSession);