The LDAP Protocol in Load runner
LDAP, the Lightweight Directory Access Protocol, is a protocol used to access a directory listing. The LDAP directory is composed of many LDAP entries. Each LDAP entry is a collection of attributes with a name, called a distinguished name (DN).
LDAP directory entries are arranged in a hierarchical structure that reflects political, geographic, and/or organizational boundaries. Entries representing countries appear at the top of the tree. Below them are entries representing states or national organizations. Below them might be entries representing
people, organizational units, printers, documents, or just about anything else.
VuGen records communication over LDAP servers. It creates a script, with functions that emulate your actions. This includes logging in and out of the server, adding and deleting entries, and querying an entry
LDAP Protocol Example Script
All LDAP functions come in pairs—one for global sessions and one where you can indicate a specific session. To apply the action to all sessions, use the version without the ex suffix. To apply the action to a specific session, use the version with the session identifier with the ex suffix. For example, mldap_logon logs on to the LDAP server globally, while mldap_logon_ex logs on to the LDAP server for a specific session.
In the following example, the user logs on to an LDAP server, ldap1. It adds an entry and then renames the OU attribute from Sales to Marketing
Action()
{
// Logon to the LDAP server
mldap_logon("Login",
"URL=ldap://johnsmith:tiger@ldap1:80",
LAST);
// Add an entry for Sally R. Jones
mldap_add("LDAP Add",
"DN=cn=Sally R. Jones,OU=Sales, DC=com",
"Name=givenName", "Value=Sally", ENDITEM,
"Name=initials", "Value=R", ENDITEM,
"Name=sn", "Value=Jones", ENDITEM,
"Name=objectClass", "Value=contact", ENDITEM,
LAST);
// Rename Sally’s OU to Marketing
mldap_rename("LDAP Rename",
"DN=CN=Sally R. Jones,OU=Sales,DC=com",
"NewDN=OU=Marketing",
LAST);
// Logout from the LDAP server
mldap_logoff();
return 0;
}
Defining Distinguished Name Entries
The LDAP API references objects by its distinguished name (DN). A DN is a sequence of relative distinguished names (RDN) separated by commas. An RDN is an attribute with an associated value in the form attribute=value The attribute names are not case-sensitive. The following table lists the most
common RDN attribute types.
LDAP Connection Options
Using the mldap_logon[_ex] function, you control the way you login to the
LDAP server. When specifying the URL of the LDAP server, you specify how to connect and with what credentials. When specifying the server’s URL, use the following format:
, comma
+ pl us sign
" double quote
\ backslash
< left angle bracket
> right angle bracket
; sem icolon
DN=CN=Bitwise,OU=Docs\, Support,DC=Fabrikam,DC=COM
DN=CN=Before\0DAfter,OU=Test,DC=North America,DC=Fabrikam,DC=COM
ldap[s][username:[password]@][server[:port]]
696
The following table shows several examples of connections to LDAP servers.
You can also specify LDAP modes or SSL certificates using the following
optional arguments:
➤ Mode. The LDAP call mode: Sync or Async
➤ Timeout. The maximum time in seconds to search for the LDAP server.
➤ Version. The version of the LDAP protocol version 1,2, or 3
➤ SSLCertDir. The path to the SSL certificates database file (cert8.db)
➤ SSLKeysDir. The path to the SSL keys database file (key3.db)
➤ SSLKeyNickname. The SSL key nickname in the keys database file
➤ SSLKeyCertNickname. The SSL key's certificate nickname in the
certificates database file
➤ SSLSecModule. The path to the SSL security module file (secmod.db)
➤ StartTLS. Requires that the StartTLS extension's specific command must
be issued in order to switch the connection to TLS (SSL) mode
LDAP directory entries are arranged in a hierarchical structure that reflects political, geographic, and/or organizational boundaries. Entries representing countries appear at the top of the tree. Below them are entries representing states or national organizations. Below them might be entries representing
people, organizational units, printers, documents, or just about anything else.
VuGen records communication over LDAP servers. It creates a script, with functions that emulate your actions. This includes logging in and out of the server, adding and deleting entries, and querying an entry
LDAP Protocol Example Script
All LDAP functions come in pairs—one for global sessions and one where you can indicate a specific session. To apply the action to all sessions, use the version without the ex suffix. To apply the action to a specific session, use the version with the session identifier with the ex suffix. For example, mldap_logon logs on to the LDAP server globally, while mldap_logon_ex logs on to the LDAP server for a specific session.
In the following example, the user logs on to an LDAP server, ldap1. It adds an entry and then renames the OU attribute from Sales to Marketing
Action()
{
// Logon to the LDAP server
mldap_logon("Login",
"URL=ldap://johnsmith:tiger@ldap1:80",
LAST);
// Add an entry for Sally R. Jones
mldap_add("LDAP Add",
"DN=cn=Sally R. Jones,OU=Sales, DC=com",
"Name=givenName", "Value=Sally", ENDITEM,
"Name=initials", "Value=R", ENDITEM,
"Name=sn", "Value=Jones", ENDITEM,
"Name=objectClass", "Value=contact", ENDITEM,
LAST);
// Rename Sally’s OU to Marketing
mldap_rename("LDAP Rename",
"DN=CN=Sally R. Jones,OU=Sales,DC=com",
"NewDN=OU=Marketing",
LAST);
// Logout from the LDAP server
mldap_logoff();
return 0;
}
Defining Distinguished Name Entries
The LDAP API references objects by its distinguished name (DN). A DN is a sequence of relative distinguished names (RDN) separated by commas. An RDN is an attribute with an associated value in the form attribute=value The attribute names are not case-sensitive. The following table lists the most
common RDN attribute types.
To use a reserved character as part of an attribute value, you must precede it with an escape character,backslash (\). If an attribute value contains other reserved characters, such as the equal sign (=) or non-UTF-8 characters, you must encode it in hexadecimal format—a backslash followed by two hex
digits. The following are examples of DNs that include escaped characters. The first example is an organizational unit name with an embedded comma; the second example is a value containing a carriage return.
LDAP Connection Options
Using the mldap_logon[_ex] function, you control the way you login to the
LDAP server. When specifying the URL of the LDAP server, you specify how to connect and with what credentials. When specifying the server’s URL, use the following format:
, comma
+ pl us sign
" double quote
\ backslash
< left angle bracket
> right angle bracket
; sem icolon
DN=CN=Bitwise,OU=Docs\, Support,DC=Fabrikam,DC=COM
DN=CN=Before\0DAfter,OU=Test,DC=North America,DC=Fabrikam,DC=COM
ldap[s][username:[password]@][server[:port]]
696
The following table shows several examples of connections to LDAP servers.
You can also specify LDAP modes or SSL certificates using the following
optional arguments:
➤ Mode. The LDAP call mode: Sync or Async
➤ Timeout. The maximum time in seconds to search for the LDAP server.
➤ Version. The version of the LDAP protocol version 1,2, or 3
➤ SSLCertDir. The path to the SSL certificates database file (cert8.db)
➤ SSLKeysDir. The path to the SSL keys database file (key3.db)
➤ SSLKeyNickname. The SSL key nickname in the keys database file
➤ SSLKeyCertNickname. The SSL key's certificate nickname in the
certificates database file
➤ SSLSecModule. The path to the SSL security module file (secmod.db)
➤ StartTLS. Requires that the StartTLS extension's specific command must
be issued in order to switch the connection to TLS (SSL) mode
LoadRunner Training in Bangalore
LoadRunner Training in Hyderabad
LoadRunner Online Training
LoadRunner Training in BTM
LoadRunner Training in Marathahalli
Best LoadRunner Training Institutes in Bangalore
Best LoadRunner Training Institutes in India
Training Institutes in Bangalorea
No comments:
Post a Comment