Last post Jul 27, 2010 05:42 PM by martinhorton
Jul 27, 2010 04:28 PM|martinhorton|LINK
In IIS6 the scenario below is working perfectly.
I have an HttpModule called URLRedirect which examines URLS and by using RegEx rewrites of applicable. An example is a URL "/doc47.pdf" gets redirected to docpdf.ashx?id=47 Then the docpdf.ashx used the id value and, using a database builds an application/pdf
document and returns it. Since I need to validate that the user has access to the data, the first line of the ProcessRequest(HttpContext context) function is:
if (context.User.Identity.IsAuthenticated) ..... This is where the problem occurs, but more details first.
... ) function.
This all works fine under IIS6 and under IIS7 if I change the mode to Classic. But, under IIS7 in integrated mode, the following happens.
The line in doc.ashx described above raises an exception because context.User == null. But, and this is interesting, if instead of using the link that opens the popup window I instead type /doc.pdf?id=47 into the address bar, the PDF document displays correctly.
So this indicates to me that the URLRedirect Module is somehow losing the logged on user information.
I'm sure this is an extremely simple fix but any help would be appreciated.
Jul 27, 2010 05:42 PM|martinhorton|LINK
Never mind. I was mapping *.pdf to the wrong Managed module - all is wonderful now.