IIS7正在丢失cffileupload(CF10)的经过身份验证的用户

时间:2013-05-09 18:41:48

标签: iis-7 coldfusion windows-authentication coldfusion-10

在我们的一个内部网页面上,我正在使用cffileupload上传多张照片:

<cffileupload extensionfilter=".jpg,.jpeg,.png,.gif"
              url="/submissions/photo_gallery.cfm"
              onerror="errorissue" 
              width="600" 
              addbuttonlabel="Browse..." 
              maxuploadsize="100">

此标记的网址指向我处理图片的同一页面:

<!--- Define the upload path --->
<cfset upload_path = "C:\websites\images\photo_gallery\">

<!--- Upload all the files --->
<cffile action="upload" 
        destination="#upload_path#" 
        nameconflict="makeunique" 
        result="uploaded_file">

在IE和Chrome中,这有效。在Firefox中,我收到401错误。它似乎与浏览器的身份验证方式有关。 IE和Chrome使用Windows身份验证,而Firefox在进入用户名/密码的网站时提示。 Coldfusion日志中没有显示任何内容,但IIS日志显示了这一点(IP x出来了):

  

2013-05-09 19:16:07 xxx.xxx.xxx.xxx POST   /submissions/photo_gallery.cfm CFID = 5546&amp; CFTOKEN = 75080018 80 - 172.28.30.99 Shockwave + Flash 401 2 5 0

日志中的上一行来自加载页面。如您所见,我的用户名显示在此行中(为安全性而编辑):

  

2013-05-09 19:16:07 xxx.xxx.xxx.xxx GET /includes/js/shared.js - 80   DOMAIN \用户名xxx.xxx.xxx.xxx   的Mozilla / 5.0 +(视窗NT + + 6.1 + WOW64; + RV:20.0)+壁虎/ 20100101 +火狐/ 20.0   304 0 0 218

所以,cffileupload似乎丢失了我的用户名。但是,cffileupload url中的session.urltoken与具有多个文件上载器(调用页面)的页面上的session.urltoken相同。所以,你认为认证会坚持下去。

此外,当我进入IIS7并在Jakarta虚拟目录上启用匿名身份验证(并禁用Windows身份验证)时,我可以在Firefox中使用它。但是,这不是一个有用的解决方案。

有人可以建议另一种解决方案吗?

2 个答案:

答案 0 :(得分:1)

您也可以告诉Firefox使用Windows身份验证。默认情况下它未启用(reference)。

  1. 打开Firefox
  2. 在地址栏中输入:“about:config”
  3. Firefox3.x及更高版本要求您同意谨慎行事。
  4. 加载配置页后,在过滤器框中输入:“network.automatic”
  5. 双击该行修改network.automatic-ntlm-auth.trusted-uris,然后输入http://www.replacewithyoursite.comhttp://your-intranet-server-name。可以通过逗号分隔多个网站,例如http://www.replacewithyoursite.com, http://www.replacewithyourintranetsite.com
  6. 要指定所有子域名,请使用.replacewithyoursite.com代替www.replacewithyoursite.com, help.replacewithyoursite.com, pictures.replacewithyoursite.com


    如果您的Intranet不使用完全限定的域名,您可以在Firefox中设置以下内容以避免提示(reference

    1. 转到“about:config”
    2. 将键过滤到“network.automatic”
    3. network.automatic-ntlm-auth.allow-non-fqdn值修改为true enter image description here

答案 1 :(得分:1)

您是否尝试过启用&#34;匿名身份验证&#34;仅用于/ submissions文件夹?

请参阅here

相关问题