| LDAP CALL Routine Interface |
| Syntax | |
| Arguments | |
| Details | |
| Examples |
Syntax |
| CALL LDAPS_OPEN(lHandle, ldapServerName, port, base, bindDN, password, rc, <options>); |
| lHandle |
returns a connection handle that is used in subsequent CALL routines to access the LDAP server session.
| ||||
| ldapServerName |
identifies the LDAP server that is to be connected to. If blank, the value defaults to the host that issued the CALL routine. Otherwise, the value must be the DNS name or IP address of a host on which an LDAP server is running.
| ||||
| port |
specifies the TCP port of the LDAP server. If the value is zero, then the standard port of 389 is used.
| ||||
| base |
specifies a distinguished name that establishes the base object for the search. The base object is the point in the LDAP tree at which you want to start searching. If this value is blank, then the default value is the macro variable or environment variable LDAP_BASE.
| ||||
| bindDN |
specifies the distinguished name that is used to bind to the server. If this value is blank, then the macro variable or environment variable LDAP_BINDDN is used as the bind-distinguished name. If the value "" is specified and the LDAP_BINDDN variable has not been set, then an unauthenticated bind is performed.
| ||||
| password |
specifies the password that is associated with the bindDN value. If this value is blank, then the macro variable or environment variable LDAP_BINDPW is used as the bind-distinguished name. If the value "" is specified and the LDAP_BINDPW variable has not been set, then an unauthenticated bind is performed. Passwords that have been encoded by using the PWENCODE procedure can be used to bind to the server. For more information, see the PWENCODE procedure in Base SAS Procedures Guide.
| ||||
| rc |
receives a return code that identifies success or failure.
| ||||
| options |
specifies one or more session options to use with this bind.
The following session options are valid:
Note: Specify only one search scope option. If multiple search scope
options are specified, then the one that appears last is used. If none of
the search scope options are specified, then the default value of SUBTREE_SEARCH_SCOPE
is used. |
| Details |
The options that are specified in the LDAPS_OPEN CALL routine include only those that must be specified when the server connection is first opened. Additional options can be specified after the connection is opened by using the LDAPS_SETOPTIONS CALL routine.
| Examples |
The following example opens a connection to an LDAP server by using an anonymous bind and default session options.
server="alpair01.unx.com";port=8010; base="sasComponent=sasPublishSubscribe,cn=SAS,o=Alphalite Airways,c=US"; bindDN=""; Pw=""; call LDAPS_OPEN(lHandle, server, port, base, bindDN, Pw, rc);
The following example opens a connection to an LDAP server, binds to the server, and passes in a session option of OPT_REFERRALS_OFF. This instructs the LDAP server not to chase referrals.
server = "alpair02.unx.com"; base = "o=Alphalite Airways,c=US"; bindDN ="cn=John Doe,o=Alphalite Airways,c=us"; bindPW ="myPass1"; option= "OPT_REFERRALS_OFF"; call LDAPS_OPEN(lHandle, server,8001,base,bindDN,bindPW,rc, option);
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.