GetAuthenticationLoginName
Description
Returns the string that a user enters as the login name when authenticating. The return value may be different from a HCL Compass user name if the user is LDAP authenticated.
Use the GetUserLoginName method to get the HCL Compass name of the user stored in the user profile record for the user.
Returns the login name used to create the Session. The value returned is the name used to authenticate the user, not the HCL Compass user login field name that is stored in the user profile record for the user. The return value may be a LDAP login name (for example, myname@xxx.com) and not a HCL Compass user name (for example, mycqname).
Syntax
VBScript
session.GetAuthenticationLoginName
Perl
$session->GetAuthenticationLoginName
();
- Identifier
- Description
- session
- The session object representing the current access session.
- Return value
- A String containing the authentication name used to create this Session.
Examples
VBScript
mySession.UserLogon "admin", "", dbName, AD_PRIVATE_SESSION, ""
set mySession = CreateObject("ClearQuest.Session")
mySession.UserLogon "admin", "", dbName, AD_PRIVATE_SESSION, ""
userLogin = mySession.GetAuthenticationLoginName
' ...
Perl
use CQPerlExt;
my ($login, $pwd, $dbname, $dbset, $cqusername) = @_;
my $authusername = $login;
my $sessionObj = CQSession::Build();
$sessionObj->UserLogon($login, $pwd, $dbname, $dbset);
my $loginname = $sessionObj->GetUserLoginName();
my $authloginname = $sessionObj->GetAuthenticationLoginName();
print "User login: $authusername , $authloginname , $cqusername, $loginname \n";
if ($loginname ne $cqusername)
{
print "User login $loginname != $cqusername!!\n";
}
if ($authloginname ne $authusername)
{
print "User authname $authloginname != $authusername!!\n";
}
CQSession::Unbuild($sessionObj);