views:

11

answers:

0

I have an ASP.NET app that supports vanity urls by means of custom IHttpHandlerFactory implementation. When requests to unavailable files/vdirs trigger a 404, this custom handler interprets the physical url from the vanity url and redirects to the right page.

The issue is, I use WindowsIdentity.GetCurrent().Name to determine the user (IIS is configured to use Windows auth), and though it mostly works just fine, sometimes the Name is empty. The situation is sporadic; there is no pattern in why/when it fails -- it is not based on browser version, specific user, and such.

In such scenarios if I simply server-redirect to the same request once again, it works fine -- but I am trying to figure out what might be happening here. Anybody has an idea why a 404 triggered request to a vanity url might cause an IHttpHandlerFactory to sometimes drop the user context? I am using IIS7.5, .Net3.5, and IE8.

Thanks.