I have two HttpHandlers
. One intercepts for any pdf file request in the url, the other for an xml request. In pdf file handler I get the username from HttpContext.Current.User.Identity.Name
but when a request is made for xml file HttpContext.Current.User.Identity.Name
is always null.
The web.config
section to intercept the handlers looks like this:
<add verb="*" path="/calderdale/*.pdf" type="NES.HiLo.Security.CalderDaleAuthenticationHandler, NES.HiLo.Security" />
<add verb="GET" path="/Pallative/*.xml" type="NES.HiLo.Security.PallativeAuthenticationHandler, NES.HiLo.Security" />
Authentication section
<authentication mode="Forms">
<forms name="KFCSAUTH" loginUrl="login.aspx" protection="All"
slidingExpiration="true" path="/" domain=".scot.nhs.uk" />
</authentication>
<authorization>
<allow users="?" />
</authorization>
<system.webServer>
<!--<validation validateIntegratedModeConfiguration="false" />-->
<handlers>
<add name="Pallative Handler" path="/Pallative/*.xml" verb="GET"
modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
resourceType="Unspecified" requireAccess="Script"
preCondition="classicMode,runtimeVersionv2.0,bitness32" />
<add name="Calderdale Handler" path="/calderdale/*.pdf" verb="GET"
modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
resourceType="Unspecified" requireAccess="Script"
preCondition="classicMode,runtimeVersionv2.0,bitness32" />
<!--<add name="Pallative Handler" path="Pallative/pallative_doc.html"
verb="GET" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
resourceType="Unspecified" requireAccess="Script"
preCondition="classicMode,runtimeVersionv2.0,bitness32" />
</handlers>
</system.webServer>