views:

167

answers:

1

i have an asp.net application that receives requests from a client software..and the request headers contain a "request 100-continue"...

i want to override IIS auto-response to request-100 header, and do that myself.. so that i can use the other headers to authenticate the user (or not).. and send a proper response depending on the state (100 continue for authenticated obviously) or a proper error msg.

+1  A: 

The way we have accomplished this type of thing, and I believe a common approach is to create an HTTP Module - Modules are called on every request that is made to your app as part of the request pipeline and has access to life-cycle events throughout the request. You can examine each requests and take action such as performing your authentication, and changing the headers based on the request. They also let you examine the outgoing response and modify it.

Notes From http://msdn.microsoft.com/en-us/library/bb398986.aspx a great resource if you are new to modules.

Hope this Helps!

PortageMonkey
i've already checked on HTTP modules, i believe they come in the request process after IIS, so they will get the request after IIS had handled it (and sent the 100 continue header)..the modifications -i believe- needs to be done against the IIS itself, and the only way i found was developing ISAPI (C++)..
Madi D.
Running IIS 6 or 7? If 7, you can create your own module for any step in the pipeline.
PortageMonkey
5 for testing, 6 for deployment.. can it also be done on 6 ?
Madi D.
Yes, although the implementation's abit different. You can register modules for most events in the ASP.NET lifecycle such as 'AuthenticateRequest', AuthorizeRequest' 'BeginRequest' etc. This link should provide the info you are looking for.About Half Way down the page on http://www.15seconds.com/Issue/020417.htm
PortageMonkey