GetAuthenticationMode

Description

Returns the current AuthenticationMode of the User.
Note: If a version 2003.06.14 HCL Compass client is in use, the GetAuthenticationMode method of the User object may return 0 (an undocumented value) as a value representing a mode of CQ_AUTHENTICATION instead of the correct value of 2. A return value of either 0 or 2 indicates CQ_AUTHENTICATION and should be handled as such in any scripts using the HCL Compass API.

No special privilege is required to call this method.

Note: This method became available in version 2003.06.14.

Syntax

VBScript


user.GetAuthenticationMode()  

Perl


user->GetAuthenticationMode(); 
Identifier
Description
user
A User object.
Return value
Returns a Long containing the AuthenticationMode of the user, else an exception is thrown.

Examples

VBScript

Public Function checkAuthentication_On_User(ByVal theUser As OAdUser)
	' Check the user's authentication mode   
	Const AD_LDAP_AUTHENTICATION = 1
	Const AD_CQ_AUTHENTICATION = 2
	Dim authentication 	 ' the user authentication mode 
	authentication = user.GetAuthenticationMode
	if authentication = AD_LDAP_AUTHENTICATION then
		checkAuthentication_On_User =  "LDAP Authenticated"
	elseif authentication = AD_CQ_AUTHENTICATION then
		checkAuthentication_On_User =  "CQ Authenticated"
	elseif authentication = 0 then
		checkAuthentication_On_User =  "CQ Authenticated"
	else
		checkAuthentication_On_User = "UNKNOWN"
	end if
end Function

Perl

sub checkAuthentication_On_User($)
# Check the user's authentication mode
{
    my $user = shift;
    $authentication = $user->GetAuthenticationMode();
    if ($authentication == $CQPerlExt::CQ_LDAP_AUTHENTICATION) {
        return "LDAP Authenticated";
    }
    if ($authentication == $CQPerlExt::CQ_CQ_AUTHENTICATION) {
        return "CQ Authenticated";
    }
        return "UNKNOWN";
	}