保护 WCF 服务的最简单方法
我环顾四周,但对 WCF 安全性的研究并没有取得多大进展。我想创建一个低风险服务,所以我只需要域外不同服务器上的客户端能够使用它所需的一些基本安全性。
WCF 中最简单的方法是什么?仅仅是通过使用证书吗?
I've been looking around and haven't been getting very far in my research of WCF security. I have a low-risk service I want to create so I just want some basic security required for client's on different servers outside of the domain to be able to use it.
What's the easiest way in WCF? Is it just through the use of certificates?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查此,它涵盖了许多安全场景,请使用适合您需要的方案。
为了进行身份验证,您可以轻松选择 用户名 安全性,您只需需要传递用户名和密码。
Check this, it covers many security scenarios, use whichever suits your need.
And for authentication purpose you can easily opt Username security, where you just need to pass user name and password.
简单加密传输的最简单方法是,如果您仅使用 net.tcp 绑定,则可以打开传输安全性或消息安全性,而无需设置证书。
使用 WsHttpBinding,消息级安全性(消息内容已加密)默认启用,并且不需要 SSL 证书。如果客户端位于同一 Windows 网络上,那么默认情况下它也会使用 Windows 身份验证和凭据,因此您应该能够启用传输安全性,而无需 SSL 证书。
如果您想通过 HTTPS 将服务公开到公共互联网,那么您需要获取 SSL 证书,并使用 httpcfg.exe(Windows Server 附带)将其绑定到运行该服务的服务器上的端口。
Easiest way to simply encrypt the transmission is if you're just using net.tcp binding, then you can turn on Transport security or Message security without needing to set up a certificate.
With WsHttpBinding message-level security (contents of the message are encrypted) is enabled by default and doesn't require an SSL cert. And if the clients are on the same Windows network then it'll use Windows Authentication and credentials by default, too, so you should be able to enable Transport security without needing an SSL cert there, either.
If you want to expose your service over HTTPS to the public internet then you'll need to obtain an SSL certificate and bind it to the port on the server that the service runs on, using httpcfg.exe (comes with Windows Server).