如何限制来自外部用户的Web服务URL调用? [英] How to restrict web service url call from external user ?
本文介绍了如何限制来自外部用户的Web服务URL调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何限制来自外部用户的网络服务网址?
谢谢
Hi,
How to restrict web service url call from external user ?
Thanks
推荐答案
点击此处保护您的网络服务 [ ^ ]
和构建安全的网络服务 [ ^ ]
Check here Securing your webservice[^]
and Building secure webservices[^]
如果要限制外部用户访问您的Web服务,然后您可以限制外部用户的IP地址
http://stackoverflow.com/questions/1075618/limit-access-of-asmx-web-service-to-specific-ip-地址/ 1075639#1 075639 [ ^ ]
如果还可以通过代码保护
If you want to restrict external users for access your web service then you can restrict external users ip address
http://stackoverflow.com/questions/1075618/limit-access-of-asmx-web-service-to-specific-ip-addresses/1075639#1075639[^]
if also can protect by code
if (!Request.IsLocal)
{
Response.StatusCode = 401;
Response.StatusDescription = "Unauthorized";
return null;
}
您需要从每个网络方法中查看它。除此之外,您可以编写自定义基本Web服务方法并在那里实现它,以便从每个Web方法调用它被检查。
如果您的Web服务是wcf服务,那么你可以实施以下策略
WCF服务行为示例:IPFilter - 允许/拒绝按IP地址访问 [ ^ ]
这篇关于如何限制来自外部用户的Web服务URL调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文