Windows 服务安全
我有一个 Windows 服务(不是 Web 服务),我需要提供一些安全性。 IE。仅授权用户运行该服务的方法。
是否可以像 Web 服务一样使用证书?谁能描述一下如何做到这一点的过程?
谢谢!
I have a Windows Service (not a webservice) and I need to provide some security. ie. Only authorise users run methods of the service.
Is it possible to use certificates like you can do for webservices? Can anyone describe the process of how one would go about doing this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
警告:我以前没有这样做过,但这似乎是一种可能的解决方案。
创建 WCF 服务并将其托管为 Windows 服务。
MSDN 上有一个关于如何执行此操作的教程
您可以使用 TCP / 命名管道进行通信,并且可以根据 WCF 中的安全选项配置其中任一选项的安全性,即
有关上述每个安全选项以及如何使用它们的详细信息,您可以 < a href="http://www.code-magazine.com/article.aspx?quickid=0611051&page=1" rel="nofollow">另请查看这篇文章
Caveat : I have not done this before but it seems like one possible solution.
Create a WCF service and host it as a Windows Service.
There is a tutorial on MSDN as to how you can do that
You can use TCP / named Pipes to communicate and can configure security for either of these based on the security options options in WCF i.e.
For details on each of the security options above and how to use them you can also check out this article
当您想要执行一些连续处理而不管用户是否登录时,您需要 Windows 服务。即使没有用户登录系统,您的 Windows 服务也会运行/处理。除此之外,Windows 服务不会公开大量方法。它只为您提供 OnStart、OnStop 等事件,以便您可以通过 Services.msc 控制您的服务。在 OnStart 中,您只需启动业务逻辑并继续执行,直到停止 Windows 服务。
Windows 服务可能不是适合您的场景的正确解决方案。
You need windows service in a scenario where you want to do some continuous processing irrespective of user logged in. Your windows service would be running/processing even if no user is logged into system. To add on to this, windows service doesn't expose bunch of methods. It only gives you events like OnStart, OnStop so that you can control your service through Services.msc. In OnStart you merely fires off your business logic and keep doing it until you stop the windows service.
Probably windows service is not the right solution for your scenario.