iis-7 – 在IIS 7.5上为使用Windows身份验证的ASHX处理程序启用PUT

我有一个ASP.NET(.NET 4)网站,它使用http PUT作为.ashx通用处理程序. PUT调用源自Silverlight前端.所有在我的本地计算机(Cassini Web服务器)上的VS 2010中工作.

然后我部署到IIS7.5 Win Server 2008 R2框.

silverlight / website很好,但是对.ashx处理程序的PUT调用遇到了Windows登录提示符.
这是本地Intranet,因此Windows身份验证(使用NTLM和协商提供程序)是唯一启用的身份验证.

然后我读到了这个:http://blogs.msdn.com/b/joseph_fultz/archive/2009/07/23/enabling-the-put-verb-with-handlers-and-iis-7-0.aspx

我已经按照他的建议,我现在可以通过我的.ashx处理程序进行PUT调用.问题是只有Web服务器的Administrators组中的人才能执行此操作.没人能.他们遇到了Windows登录提示.

知道这可能是什么?

我无法在网络服务器上给公司管理员权限.毫无疑问,他们会切断我的一只手,在我面前吃手,然后告诉我门.

好吧我明白了.

以下是IIS 7.5中的关键配置元素:

>在Windows身份验证/提供程序下 – NTLM必须位于Negotiate之上
>域用户需要对包含ashx处理程序的目录的写访问权
> URL授权未在Web服务器上作为角色启用.我添加了它,然后将其粘贴在system.webServer下的web.config中:

<security>
    <authorization>
        <remove users="*" roles="" verbs="" />
        <add accesstype="Allow" users="*" verbs="GET,HEAD,POST,PUT,DELETE,DEBUG" />
    </authorization>
</security>

(我会减少一点,但现在它的工作原理)

我的整个system.webServer元素如下:

<system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>
    <defaultDocument>
        <files>
            <clear />
            <add value="default.aspx" />
        </files>
    </defaultDocument>
    <handlers accesspolicy="Read,Write,Execute,Script">
        <remove name="WebDAV" />
        <remove name="SimpleHandlerFactory-Integrated-4.0" />
        <remove name="SimpleHandlerFactory-Integrated" />
        <add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="GET,DEBUG,PUT" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Write" preCondition="integratedMode" />
        <add name="SimpleHandlerFactory-Integrated-4.0" path="*.ashx" verb="GET,PUT" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Write" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
    <security>
        <authorization>
            <remove users="*" roles="" verbs="" />
            <add accesstype="Allow" users="*" verbs="GET,DEBUG" />
        </authorization>
    </security>

</system.webServer>

这样做了.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...