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

Iis 7 使用Windows身份验证为ASHX处理程序启用IIS 7.5上的PUT,iis-7,iis-7.5,windows-authentication,put,Iis 7,Iis 7.5,Windows Authentication,Put,我有一个ASP.NET(.NET 4)网站,它使用http PUT作为.ashx通用处理程序。PUT调用源自Silverlight前端。所有这些都在VS2010中在我的本地机器(Cassini web服务器)上运行 然后我部署到IIS7.5 Win Server 2008 R2机箱 silverlight/网站正常,但对.ashx处理程序的PUT调用会遇到Windows登录提示。 这是一个本地intranet,因此Windows身份验证(使用NTLM和协商提供程序)是唯一启用的身份验证 然后我读

我有一个ASP.NET(.NET 4)网站,它使用http PUT作为.ashx通用处理程序。PUT调用源自Silverlight前端。所有这些都在VS2010中在我的本地机器(Cassini web服务器)上运行

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

silverlight/网站正常,但对.ashx处理程序的PUT调用会遇到Windows登录提示。
这是一个本地intranet,因此Windows身份验证(使用NTLM和协商提供程序)是唯一启用的身份验证

然后我读到:

我已经听从了他的建议,现在可以通过.ashx处理程序拨打PUT电话。问题是只有web服务器的Administrators组中的人员才能这样做。没有其他人可以。他们会遇到windows登录提示

知道这是什么吗

我不能给公司里的每个人在Web服务器上的管理员权限。毫无疑问,他们会砍掉我的一只手,吃了我面前的那只手,然后把门指给我看。

好的,我知道了

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

  • 在Windows身份验证/提供程序下,NTLM必须位于协商之上
  • 域用户需要对包含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,HEAD,POST,DEBUG,PUT" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Write" preCondition="integratedMode" />
            <add name="SimpleHandlerFactory-Integrated-4.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG,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,HEAD,POST,PUT,DELETE,DEBUG" />
            </authorization>
        </security>
    
    </system.webServer>
    
    
    

    成功了

    任何针对.net 3.5应用程序的解决方案