IIS7 Itegrated Pipeline Mode: Context.User breaks null for Windows Auth

Our code relies on checking the Context.User.Identity value in the Global.asax Application_AuthenticateRequest (...) method to get some information about the logged in user. This works fine in classic mode, but when I flip IIS to use the Integrated Pipeline, "Context.User" is returned as null, but only intermittently. Any ideas why?

I have <authentication mode = "Windows"> and only the Windows virtual machine is enabled in the virtual directory.

+2


a source to share


1 answer


Integrated mode means ASP.NET pipeline events are executed concurrently with the IIS pipeline, which means: 1) In classic mode - AuthenticateRequest in ASP.NET is fired after IIS has already authenticated (using Windows auth, perhaps or basic, etc.) etc.) and so you will get the user id set on it. 2) In IntegratedMode - AuthenticateRequest will work at the same time in both cases, which will result in it being null. You should consider using PostAuthenticateRequest if you want to reliably get the user id (assuming you have the authentication module enabled, of course)



+4


a source







All Articles