Bind (LDAP function)
Connect to a remote LDAP server (LDAP class)
[%number =] ldap:Bind[( [JanusPort= name], [LDAPServer= hostid], - [PortNumber= number], [UserID= login], - [Password= pwd], [Options= sslvalue])]
|%number||A float variable to contain the status result of the Bind.
These status values are possible:
|ldap||An LDAP object variable.|
|JanusPort||The name of a Janus CLSOCK port.
This is an optional and name required parameter. If not provided for (for example, by a MASTER specification) in the CLSOCK port definition under which this Bind method is being used, you must specify a value here. And if you specify a value, you must include the parameter name.The default is the MASTER port, if any is defined. However, if you omit a port name specification, and no MASTER port is defined, the request is canceled.
|LDAPServer||The HTTP host name (fully qualified domain name) or IP address of the target LDAP server host machine. This is an optional and name required parameter.
If the LDAP host or IP address is fully specified on the associated Janus port definition REMOTE clause, you may omit a parameter specification here. If an asterisk (*) is specified for the remote host on the port definition, you must identify the LDAP server here.
In any case, if you specify a value for this parameter:
|PortNumber||The TCP/IP port number of the target LDAP server. This is an optional and name required numeric parameter.
If you specify a port number value, you must:
If you omit PortNumber and a value, or set it to zero:
The Bind call uses the port number specified in the associated Janus port definition. If that port definition has no port number specified (or if an asterisk (*) is specified), the Bind call uses either:
|UserID||The string with which you log on to an LDAP server. This is an optional and name required string parameter; its default is a null string. Some LDAP servers accept a null string ("anonymous") login, and some require a null string login. The login maximum is 255 characters.|
|Password||The password for UserID. This is an optional and name required string parameter; its default is a null string. The pwd maximum is 255 characters.|
|Options||This name required, optional, string argument selects whether SSL encryption is attempted for this connection. However, specifying an Options argument is only meaningful when the JANUS DEFINE command for the associated CLSOCK port specifies both the SSL and SSLOPT parameters. When both these parameters are set in the port definition, SSL encryption is offered on the connection attempt only if the Bind method explicitly requests it by setting |
Options may be either of the following values, although the value must not conflict with the explicit or implicit SSL setting on the port definition. If you omit an Options argument, SSL usage depends entirely on the CLSOCK port definition. For more information about Janus SSL support, see the Janus Network Security Reference Manual.
- You can change your target LDAP server by changing the Janus port definition without having to touch your application code. That is, you can omit the port name and server name arguments, and let the port definition MASTER and REMOTE arguments do the work.
The following statement uses the JANUS CLSOCK port named
establish an encrypted socket connection with the LDAP
server whose HTTP domain name is the value assigned in the request
The ID set in
%ldS1usr and the password set in
are needed for login to this particular LDAP server.
%status = %ld:Bind(JanusPort='LDAPSOCK1', - LDAPServer=%ldSrv1, - UserID=%ldS1usr, - Password=%ldS1pwd, - Options='SSL')