Directory Services |
The ADS_AUTHENTICATION_ENUM enumeration specifies authentication options used in ADSI for binding to directory service objects. When calling IADsOpenDSObject or ADsOpenObject to bind to an ADSI object, provide at least one of the options. In general, different providers will have different implementations. The options documented here apply to the providers supplied by Microsoft included with the ADSI SDK. For more information, see ADSI System Providers.
typedef enum { ADS_SECURE_AUTHENTICATION = 0x1, ADS_USE_ENCRYPTION = 0x2, ADS_USE_SSL = 0x2, ADS_READONLY_SERVER = 0x4, ADS_PROMPT_CREDENTIALS = 0x8, ADS_NO_AUTHENTICATION = 0x10, ADS_FAST_BIND = 0x20, ADS_USE_SIGNING = 0x40, ADS_USE_SEALING = 0x80, ADS_USE_DELEGATION = 0x100, ADS_SERVER_BIND = 0x200 } ADS_AUTHENTICATION_ENUM;
The ADS_SECURE_AUTHENTICATION flag can be used in combination with other flags such as ADS_READONLY_SERVER, ADS_PROMPT_CREDENTIALS, ADS_FAST_BIND, and so on.
Serverless binding refers to a process in which a client attempts to bind to an Active Directory object without explicitly specifying an Active Directory server in the binding string. This is possible because the LDAP provider relies on the locator services of Windows® 2000 to find the best domain controller (DC) for the client. However, the client must have an account on the Active Directory domain controller in order to take advantage of the serverless binding feature, and the DC used by a serverless bind will always be located in the default domain; that is, the domain associated with the current security context of the thread that performs the binding.
Note None of these options are supported by the NDS or NWCOMPAT system providers.
Because VBScript cannot read data from a type library, VBScript applications do not understand the symbolic constants as defined above. Use the numerical constants instead to set the appropriate flags in your VBScript applications. To use the symbolic constants as a good programming practice, make explicit declarations of such constants, as done here, in your VBScript application.
The following code example shows how to use IADsOpenDSObject to open an object on fabrikam with secure authentication for the WinNT provider.
[Visual Basic]
Dim dso As IADsOpenDSObject
Dim domain As IADsDomain
Set dso = GetObject("WinNT:")
Set domain = dso.OpenDSObject("WinNT://Fabrikam", vbNullString, vbNullString, ADS_SECURE_AUTHENTICATION)
The following code example shows how the ADS_SECURE_AUTHENTICATION flag is used with ADsOpenObject for validating the user bound as "JeffSmith". The user name can be of the UPN format: "JeffSmith@Fabrikam.com", as well as the distinguished name format: "CN=JeffSmith,DC=Fabrikam,DC=COM".
[C++]
IADs *pObject = NULL;
HRESULT hr;
hr = ADsOpenObject(_bstr_t("LDAP://CN=JeffSmith, DC=fabrikam, DC=com"),
NULL,
NULL,
ADS_SECURE_AUTHENTICATION,
IID_IADs,
(void**) &pObject);
if (hr != S_OK)
{} // Handle open object errors here.
else
{} // Object was retrieved, continue processing here.
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.
ADSI Enumerations, ADSI System Providers, ADsOpenObject, IADsOpenDSObject, IADsAccessControlEntry