使用 IP 保护 Web 服务 (WCF) 的推荐方法? [英] Recommended way of protecting web service (WCF) with IP?

查看:27
本文介绍了使用 IP 保护 Web 服务 (WCF) 的推荐方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要保护我的 WCF Web 服务,并且正在考虑这样做的最佳方法是什么.它不是真正的角色/用户情况 - 更多的是谁可以调用网络服务".

I need to protect my WCF web services and was thinking what is the best way of doing this. Its not really a ROLE / User situation - more of a "WHO CAN CALL THE WEB SERVICE".

我在想我可以使用 IP 吗?这是推荐的方式吗?

I was thinking that i could use an IP? Is this the recommended way?

任何人都有这方面的经验,我想有一个表 (sql),其中包含可以访问 Web 服务的所有 IP,但如果已经存在某些内容,我不想重新发明轮子.

Anybody have any experience with this, I was thinking of have a table (sql) with all IPs that can access the web service but i didn't want to reinvent the wheel if something exists already.

我认为当有人访问网络服务时有一个事件或类似事件,所以我可以检查那里的 ip?- 有人举个例子吗?

I presume there is an event or similar when somebody access the webservice so i can check there ip? - Anybody have an example?

我认为这可以通过标准的 HTTP 绑定来完成?

And i presume this can be accomplished with standard HTTP binding ?

如果有人提出任何意见,我将不胜感激

I would appreciate any input anybody has

推荐答案

您可以使用服务行为非常轻松地限制服务中的调用 IP.

You can pretty easily restrict the calling IP's in your service using a service behavior.

有一篇出色的 CodeProject 文章,其中包含展示如何操作的源代码这个.由于它是 WCF 和 WCF 行为,因此它也是可插入的 - 您可以根据需要从服务中添加或删除它.

There's an excellent CodeProject article including source code that shows how to do this. Since it's WCF and a WCF behavior, it's pluggable, too - you can add or remove it from your service as needed.

马克

这篇关于使用 IP 保护 Web 服务 (WCF) 的推荐方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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