SAS Institute. The Power to Know

SAS(R) 9.2 Integration Technologies: Directory Services Reference

Previous Page | Next Page

LDAP CALL Routine Interface

LDAPS_OPEN



Opens a connection to an LDAP server
Syntax
Arguments
Details
Examples

Syntax

CALL LDAPS_OPEN(lHandle, ldapServerName, port, base, bindDN, password, rc, <options>);

Arguments

lHandle

returns a connection handle that is used in subsequent CALL routines to access the LDAP server session.

Type: Numeric
Direction: Output
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.

Type: Character
Direction: Input
port

specifies the TCP port of the LDAP server. If the value is zero, then the standard port of 389 is used.

Type: Numeric
Direction: Input
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.

Type: Character
Direction: Input
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.

Type: Character
Direction: Input
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.

Type: Character
Direction: Input
rc

receives a return code that identifies success or failure.

Type: Numeric
Direction: Output
options

specifies one or more session options to use with this bind.

Type: Character
Direction: Input

The following session options are valid:

OPT_REFERRALS_OFF

instructs the server to not chase referrals. Specifying this option overrides the default value of OPT_REFERRALS_ON.

SUBTREE_SEARCH_SCOPE

sets the scope of the search to include all subtrees. This is the default value.

BASE_SEARCH_SCOPE

sets the scope of the search to include only the base. This value overrides the default value of SUBTREE_SEARCH_SCOPE.

ONELEVEL_SEARCH_SCOPE

sets the scope of the search to include the base and one additional level. This value overrides the default value of SUBTREE_SEARCH_SCOPE.

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.  [cautionend]


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);

Previous Page | Next Page | Top of Page