限制asmx Web服务对特定IP地址的访问 [英] Limit access of asmx web service to specific IP addresses

查看:299
本文介绍了限制asmx Web服务对特定IP地址的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要限制.asmx Web服务对特定IP地址的访问。我想我可以在每个方法中添加一个硬编码检查,但这似乎是代码维护的噩梦。是否有我可以进行的Web配置条目,或者我可以应用于.asmx文件的IIS 6设置?

I need to limit access of an .asmx web service to specific IP addresses. I figure I could add a hardcoded check into each method, but that seems like a code maintenance nightmare. Is there a web configuration entry I can make, or a IIS 6 setting I can apply to the .asmx file?

推荐答案

在IIS 6.0管理器中,右键单击.asmx文件。

In IIS 6.0 Manager, right click on the .asmx file.

转到文件安全性选项卡,然后单击IP地址和域名限制中的编辑按钮。

Go to the File Security tab, and Click the Edit button in the IP Address and domain name restrictions.

单击拒绝访问单选按钮,然后添加列入白名单的IP地址。

Click the 'Denied Access' radio button, then add your whitelisted ip addresses to the list.

对于IIS 7.5,由于文件未在导航面板中显示,因此有点棘手。您需要转到内容视图选项卡(在窗口的下半部分),右键单击您的文件并选择切换到功能视图。打开IP地址和域限制,单击编辑功能设置,然后选择拒绝未指定的主机。现在,您可以通过单击添加允许条目来添加授权。

For IIS 7.5, it's a little tricky as the file doesn't show in the navigation panel. You need to go to the Content View tab (in the lower part of the window), right click on your file and choose Switch to Features View. Open IP Address and Domain Restriction, click on Edit Feature Settings and choose to deny unspecified hosts. Now you can add authorizations by clicking on Add Allow Entry.

这篇关于限制asmx Web服务对特定IP地址的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆