简体   繁体   English

IIS:匿名和WIndows身份验证

[英]IIS: Anonymous and WIndows Authentication

Scenario 脚本

For a multiple file uploader I am implementing, I need to have a handler within a windows authenticated site that uses anonymous access. 对于我正在实现的多文件上传器,我需要在使用匿名访问的Windows身份验证站点中拥有一个处理程序。

As detailed here , this is because Flash cannot use windows authentication. 至于详细的在这里 ,这是因为Flash无法使用Windows身份验证。 The aforementioned post states that the only way to accomplish this is to create a completely separate site. 上述帖子指出,实现此目标的唯一方法是创建一个完全独立的站点。 However, this seems like a big hassle just for an uploader. 然而,对于上传者而言,这似乎是一个很大的麻烦。

Is there a way to work around this limitation of IIS? 有没有办法解决IIS的这种限制?

Notes 笔记

I am using asp.net 3.0 and IIS6 on a Windows 2003 Server with Service Pack 2. 我在带有Service Pack 2的Windows 2003 Server上使用asp.net 3.0和IIS6。

You can create a virtual directory as a sub-directory to the main site. 您可以将虚拟目录创建为主站点的子目录。

  1. Create a folder somewhere on the machine. 在机器上的某个位置创建一个文件夹。 Make sure the IUSR account has read/write access to this folder. 确保IUSR帐户具有对此文件夹的读/写访问权限。

  2. Create a virtual directory in your website through IIS. 通过IIS在您的网站中创建一个虚拟目录。 Point it to the folder you created above. 将其指向您在上面创建的文件夹。

  3. Allow anonymous access on the virtual directory, and clear windows authentication. 允许匿名访问虚拟目录,并清除Windows身份验证。

You should be good to go. 你应该好好去。 Please note that, with anonymous access, anyone will be able to read/write to this folder, even without using your Flash application. 请注意,通过匿名访问,即使不使用Flash应用程序,任何人都可以读取/写入此文件夹。

The way I've done this in the past was to store the documents in a database, and require a session token to be passed from the Flash application before returning the file from the database. 我过去这样做的方法是将文档存储在数据库中,并且需要在从数据库返回文件之前从Flash应用程序传递会话令牌。 You can apply a similar approach to a file share (make a upload.aspx that will check the auth then grab the file from a folder that is not accessible from the web). 您可以对文件共享应用类似的方法(制作upload.aspx,它将检查auth,然后从无法从Web访问的文件夹中获取文件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM