Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

LdapVariables Object

 

The LdapVariables object exposes methods for manipulating attributes in the LDAP plug-in variable table.

Note

If you are trying to access a binary attribute value, you must use the “= bin” syntax for the attribute in the [Attributes] section of ldapauth.aut file. The result is returned to JavaScript as a raw binary (not hexadecimal-coded) string.

LdapVariables Methods

LdapVariables Methods

LdapVariables.Get()

LdapVariables.Get()

Purpose

The LdapVariables.Get() method retrieves the current value or values for a variable stored in the LDAP variable table. LdapVariables.Get() can be used to retrieve binary (raw) data or text strings.

Syntax

Parameters

Table 145: LdapVariables.Get() Parameters

Parameter

Description

VariableName

Specifies the name of the variable in the variable table.

nItem

Specifies the index of the value for multi-valued attributes. You can specify the value of nItem as part of the command, or you can use a separate variable to set the value of nItem (as shown in this example).

Returns

The value of the specified attribute, or a null value if the attribute does not exist or if the index is out of bounds.

Examples

This example illustrates a single-value attribute lookup:

This example illustrates a multi-value attribute lookup:

LdapVariables.Add()

LdapVariables.Add()

Purpose

The LdapVariables.Add() method creates a new variable or adds a value to an existing variable.

Syntax

LdapVariables.Add(variableName, value[, raw])

Parameters

Table 146: LdapVariables.Add() Parameters

Parameter

Description

variableName

Specifies the name of the variable to be created or updated.

  value

Specifies the value of the variable, which might be text or binary data.

  raw

  • If set to True, specifies that the value is binary data.

  • If set to False, specifies that the value is text.

Default value is False.

Returns

Nothing.

Example

LdapVariables.Add(“Vpn-User-Name”, “Fred” );

LdapVariables.Reset()

LdapVariables.Reset()

Purpose

The LdapVariables.Reset() method deletes all of the values of the specified variable from the variable table. If the specified variable does not exist, the method call is ignored.

Syntax

LdapVariables.Reset(variableName)

Parameters

Table 147: LdapVariables.Reset() Parameters

Parameter

Description

VariableName

Specifies the name of the variable to be removed from the table.

Returns

Nothing.

Example