通过 HTTP 进行 WCF 服务用户名/密码身份验证,无需 SSL
我想保护从客户端发送用户名和密码并使用 CustomUserNamePasswordValidator 的简单 WCF 服务。对于我在网络上尝试的每个示例,我都陷入了巨大的配置和模糊的错误、SSL、证书等......
最相似的替代方案(让您更好地理解)是传递“serviceUsername”和“servicePassword”参数(可能是散列)到服务的每个方法并在此处执行身份验证,但我承认这是一个丑陋且肮脏的解决方案。
我不介意加密凭据,因为它不会成为安全关键服务。我只需要基本的保护。
谢谢你!
亚历山德罗
I would like to protect a simple WCF service sending username and password from the client and using a CustomUserNamePasswordValidator. With every example I try on the Web I am stuck behind huge configurations and obscure errors, SSL, certificates, etc...
The most similar alternative (to let you understand better) would be to pass a "serviceUsername" and "servicePassword" parameter (maybe hashed) to each and every method of the service and perform authentication here, but I admit it's an ugly and dirty solution.
I don't mind encrypting credential, because it won't be a security critical service. I need only a basic form of protection.
Thank you!
Alessandro
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了使用 BasicHttpBinding 进行用户名/密码身份验证,您无法实现,因为 WCF 对通过通道以明文形式传递用户名/密码施加了限制。
为了解决这个问题,我们有一个名为 ClearUserNameBinding。此绑定允许您通过通道传递用户名/密码,类似于 BasicHttpBinding
In order to use Username/password authentication with BasicHttpBinding you cannot achieve as WCF imposes a restriction of passing username/password in clear text over the channel.
In order to overcome this issue we have something called ClearUserNameBinding. This binding allows you to pass username/password over the channel which is similar to BasicHttpBinding