ASSX HTTP 处理程序和表单身份验证

发布于 2024-10-19 17:22:28 字数 67 浏览 6 评论 0原文

我有一个 ashx 处理程序,用于从弹性页面上传文件。我无法扩展表单身份验证来保护 ashx 文件。有办法做到这一点吗?

I have an ashx handler that I use to upload files from a flex page. I have been unable to extend forms authentication to protect the ashx file. Is there anyway to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寻找一个思念的角度 2024-10-26 17:22:28

您始终可以在 .ashx 文件中检查 context.Request.IsAuthenticated。 (链接

You can always check context.Request.IsAuthenticated in your .ashx file. (link)

臻嫒无言 2024-10-26 17:22:28

您可以在与 ashx 文件相同的目录中添加一个 web.config 文件,其中包含以下内容(我认为):

  <?xml version="1.0" encoding="utf-8" ?>
  <configuration>

    <system.web>

      <authorization>
        <deny users="?"/>
      </authorization>

    </system.web>
  </configuration>

You could ways add a web.config file in the same directory as the ashx file with the following contents (i think):

  <?xml version="1.0" encoding="utf-8" ?>
  <configuration>

    <system.web>

      <authorization>
        <deny users="?"/>
      </authorization>

    </system.web>
  </configuration>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文