Hi,
we want to achieve the following:
- We use a custom module to handle application requests. It has to react on any URL and thus is written as IHttpModule
- We still want to use IIS authentication to do authentication. I.e. it should still be possible to set the authentication method in IIS and only trigger our module as soon as authentication is done.
But we could not make that work. We finally removed all modules using the <clear /> statement in the modules list and only added the AuthenticationModule the StaticFileHandler and our own module:
<system.web><authentication mode="Windows" /><compilation debug="true" targetFramework="4.5" /><httpRuntime requestPathInvalidCharacters="" /><pages validateRequest="false" controlRenderingCompatibilityVersion="4.0" /></system.web><system.webServer><modules runAllManagedModulesForAllRequests="true"><clear /><add name="BasicAuthenticationModule" /><!--<add name="QumramModule" type="Qumram.Server.Initialization.Module" preCondition="" />--><add name="DefaultDocumentModule" /><add name="StaticFileModule" /></modules><security><requestFiltering allowDoubleEscaping="true"><hiddenSegments><clear /></hiddenSegments></requestFiltering></security><httpErrors errorMode="Detailed" /><validation validateIntegratedModeConfiguration="false" /></system.webServer>
As long as our own module is commented out everything works fine. I.e. authentication triggers and then a default index.html is delivered.
If we uncomment our module then the following happens:
- Authentication does not trigger anymore
- Our module is called and executed. No user context is set (No AUTH_USER server variable either).
The QumramModule binds to
- onAuthenticateRequest
- onError
- onEndRequest
In our understanding and reading the documentation, modules should be triggered in the order of appearance. As the built in authentication module will certainly also bin to onAuthenticateRequest (if not even to onBeginRequest), we would assume, that this module would be triggered before our own module and require authentication. But it simply does not happen anything.
What is wrong here? Did we understand something wrongly? How to change the behavior and make sure the AuthModule will be triggered before our module is?
Best regards,
Simon
P.S. Did not really find a matching forum. Tried to post it in iis.net to, but cannot sign in there with my credentials.