CreateUserLDAPAuthenticated
Description
Creates a DevOps Plan 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 DevOps Plan 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 DevOps Plan 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 DevOps Plan user
profile field that is used for correlating LDAP user records to DevOps Plan user
records is the CQLDAPMap field.
If CQ_LOGIN_NAME is configured as
the mapping field (using the installutil setcqldapmap subcommand
to specify which DevOps Plan user
profile field is used to correlate LDAP and DevOps Plan 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 DevOps Plan user account (CQ_user_name) of the same name
- The value of the LDAP attribute used to map an LDAP to a DevOps Plan user is not retrieved
CQ_LOGIN_NAMEis 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
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 DevOps Plan user profile name that will be stored in the DevOps Plan application. It must not match any existing DevOps Plan user account names.
- Return value
- None on success, else an exception.
Example
Perl
use CQPerlExt;
# Create a DevOps Plan 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);