如何允许某些特定的 IP 地址访问我的 WCF 服务 [英] How to allow some specific IP address to access my WCF Service

查看:26
本文介绍了如何允许某些特定的 IP 地址访问我的 WCF 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 WCF 服务返回 xml.我只想要一个 IP 地址来访问它,例如:10.0.0.5

I have one WCF Service returns xml. I want only one IP address to access it for eg: 10.0.0.5

谁能告诉我我该怎么做.请告诉我除了防火墙和 IIS

can some one tell me how can i do this. Please tell me other than Firewall and IIS

推荐答案

你需要添加 ip 过滤,类似于 next - https://stackoverflow.com/a/803813/182344

You need to add ip filtering, something like next - https://stackoverflow.com/a/803813/182344

或使用 ServiceAuthorizationManager.CheckAccessCore您从 OperationContext 获取客户端 IP 的位置.

Or use ServiceAuthorizationManager.CheckAccessCore where you get client IP from OperationContext.

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

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