ISAPI authentication filter
"AuthFilt demonstrates how to write an authentication filter based on an external datasource. Authentication is the process of accepting or denying a request from a client, so AuthFilt will be notified each time an authentication request comes in. This sample uses a file (userdb.txt) to keep track of authorized users, but you might modify this sample to access a database which holds user info.
For each authentication request, AuthFilt first looks in a cache of recently authenticated users, and when that fails, AuthFilt looks in the userdb.txt file. This shows an efficient way to authorize connections: a cache allows the filter to quickly authenticate users, and because each request comes in through the filter, speed is critical."
The project is a standard appwizard generated ISAPI filter. The global functions of the AuthFilt Microsoft sample were encapsulated in the filter class. There are 3 parameters that can be changed to fine tune the filter: the maximum number of cached users, the position after which a cached entry will be moved to the front of the list (to make the search time shorter!) and the name of the file that contains the username/password pairs and the appropriate NT account the username/password should be mapped to. All this parameters are #define directives in the authflit.h header file.
The filter could be improved in several ways: using a database instead of a file for authentication information (you should consider using stored procedures to search and/or to cache!), load parameters from registry, automatic selection of the number of cached users and the list reorder parameter, etc.
The full source code is provided, you will have to compile it in order to get a working filter. Once you have compiled the project you will need to take the following steps to install:
- Run REGEDT32.EXE and modify the server's registry as follows. Select the Filter DLLs key in HKEY_LOCAL_MACHINE\CurrentControlSet\Services\W3SVC\Parameters. Add a local path to authfilt.dll, usually C:\WinNT\System32\InetSrv\authfilt.dll. The filter entries are separated by commas. The order is important, if you have other authentication filter with the same priority, the first one listed will receive the authentication request.
- Copy the authfilt.dll file to the directory you specified in the registry.
- Make sure the System account have execute rights on the filter dll file.
-
Edit the userdb.txt file so it contains valid users and passwords. The format of the file is:
User1:Password1, NTUser1:NTPassword1
User2:Password2, NTUser2:NTPassword2
User3:Password3, NTUser3:NTPassword3
- Copy the userdb.txt file to the directory you specified in the authfilt.h header file for the user database.
- Make sure the System account have read rights on the userdb.txt file.
- Restart the WWW service.
Last updated: 31 October 1998

Comments
How to send request to Http Ext
Posted by Legacy on 03/19/2003 12:00amOriginally posted by: Azhar
ReplyIsapi Filter Logon page
Posted by Legacy on 10/31/2002 12:00amOriginally posted by: Steven
Hello,
I was able to get the AuthFilter working fine with validating a user against a database and mapping to an NT account (Windows 2000).
I was wondering if anyone knows how to replace the popup window for the username and password (Basic authentication) with a standard HTML web page?
Thank you for any suggestions.
Steven
ReplySetting REMOTE_USER
Posted by Legacy on 08/27/2002 12:00amOriginally posted by: ballya
Replywhat's mean?
Posted by Legacy on 01/16/2002 12:00amOriginally posted by: cxd
Add a local path to authfilt.dll, usually C:\WinNT\System32\InetSrv\authfilt.dll. The filter entries are separated by commas
ReplyTrap STATUS_PASSWORD_EXPIRED
Posted by Legacy on 12/19/2001 12:00amOriginally posted by: senthilkumarrajagopal@csc.com
Replydoubt on isapi
Posted by Legacy on 11/25/2001 12:00amOriginally posted by: jeyasaravanan
Currently i am doing a project of Developing a New Scripting language like
Active Server PAges(ASP).
I am planning to implement some intrinsic functions like looping,conditional checking,printing statements as like in ASP.
I am using Visual C++ for doing my project as it has got some readymade classes which help for it.
After this I am planning to provide a server which will understand this scripting language and display as a web page.
Kindly send me any source code if you can get it regarding my project at the earliest.
My Scripting Language has statements which follows the 'C' style
So the problem for me is like i am trying this new concept and i need your help in doing my Project.
Kindlly reply at the earliest.
Kindly send me any source code if you can get it regarding my project
yours faithfully
R.K.JEYASARAVANAN
( rkjs1@yahoo.com )
software requirements : Windows NT with server with OPTION PACK 4 AND VC++(Version 6)
ReplyGives Erro :The specified procedure could not be found
Posted by Legacy on 09/13/2001 12:00amOriginally posted by: Shahzad
ReplyAuthentication problem
Posted by Legacy on 06/09/2001 12:00amOriginally posted by: Tushar Desai
ReplyISAPI Authentication Filter
Posted by Legacy on 06/04/2001 12:00amOriginally posted by: Barb Kellerbauer
I too am experiencing intermittent problems after moving to Windows 2000 IIS version 5.0.
Any suggestions would be greatly appreciated.
Thanks,
Barb Kellerbauer
Replykellerbb@atsc.army.mil
the problem to apply to Windows 2000 server
Posted by Legacy on 04/20/2001 12:00amOriginally posted by: Bumkyu Kim
Hi,
I am Bumkyu Kim for Hunter Tech in Korea.
When I applled to Windows NT Server 4.0 this filter,
I had'nt special problem.
But, as for Windows 2000, this filter did not operate.
Help me Please. Thank you....
ReplyLoading, Please Wait ...