Http handler for classic ASP application for introducing a layer between client and server

asp-classicasp.nethttp-requestwebsites

I've a huge classic ASP application where in thousands of users manage their company/business data. Currently this is not multi-user so that application users can create users and authorize them to access certain areas in the system.

I'm thinking of writing a handler which will act as middle man between client and server and go through every request and find out who the user is and whether he is authorized to access the data he is trying to.

For the moment ignore about the part how I'm going to check the authorization and all that stuff. Just want to know whether I can implement a ASP.net handler and use it as middle man for the requests coming for a asp website? I just want to read the url and see what is the page user is trying to access and what are the parameters he is passing in the url the posted data. Is this possible? I read that Asp.net handler cannot be used with asp website and I need to use isapi filter or extensions for that and that can be developed only c/c++.

Can anybody through some light on this and guide me whether I'm in the right direction or not?

Best Answer

A .Net handler can't be used with ASP because IIS can only hand the request off to one handler for each request. ASP and .Net have distinct handlers.

If you wanted to write a .Net HTTPModule to act as a Man in the Middle, the handler for the request would need to be .Net.

I've not tried it, but I reckon if you then wrote a .Net HTTPHandler to service the ASP page (which basically just runs the ASP as a VBScript), you'd have complications with the Request and Response objects. Probably more effort than its worth even trying.

An ISAPI Filter would be the most straight-forward way to go but may not be practical if you don't have the C++ experience. But what you're doing doesn't sound like particularly new ground and there may be an existing implementation you can use.

Related Topic