The GetAuthTypes method returns an integer specifying the allowed authentication methods for the specified IIS meta-base path.
IDL Definition
HRESULT GetAuthTypes(
BSTR bszPath,
[out, retval] LONG *plTypes
);
Parameters
bszPath
the URL to get the authentication type for
plTypes
on return, the address of a LONG variable containing the integer specifying the allowed authentication types. The integer is a bit-wise "OR" of the allowed types listed above.
Return Values
a standard HRESULT value
Remarks
The integer is composed of an "OR" bit-mask of the values listed below. (e.g. val | val2 | val3 ). The bits, all being powers of "2", are listed below in their base 10 integer equivalents.
Authentication Method | Integer value |
Anonymous | 1 |
PwdCookie | 2 |
Basic | 4 |
DPA | 8 |
The following definitions are available through the type library when using C/C++:
const LONG BROK_AUTH_TYPE_ANON = 0x0001;
const LONG BROK_AUTH_TYPE_PWDCOOKIE = 0x0002;
const LONG BROK_AUTH_TYPE_BASIC = 0x0004;
const LONG BROK_AUTH_TYPE_DPA = 0x0008;
Example
Path = "/LM/W3SVC/3/ROOT/dir1"
Set ObjCreator = CreateObject("ObjCreator.ObjCreator.1")
Set MemServers = ObjCreator.CreateObjAuth("MemAdmin.BrokServers.1")
call MemServers.GetAuthTypes(Path,ltypes)
if ltypes And 1 Then
wscript.echo "Anonymous allowed"
Else if ltypes And 2 Then
wscript.echo "PwdCookie allowed"
Else If ltypes And 4 Then
wscript.echo "Basic allowed"
Else if ltypes And 8 Then
wscript.echo "DPA allowed"
End If