Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个 WCF 服务,它通过 NetNamedPipeBinding 协议托管在 Windows 服务上。现在我想为这个服务提供安全性,因为只有知道用户名和密码的用户才能访问这个服务。那么我如何提供方法级别的身份验证用户访问此服务?
NetNamedPipe 绑定不支持开箱即用的消息级别安全性。那将需要自定义绑定。NetNamedPipe 绑定仅在服务和客户端都在同一台机器上运行时才有效,因此假设用户有权登录并且服务正在运行,她也有权调用它。如果您需要限制可以调用该服务的用户,您始终可以使用自定义授权管理器或基于角色的安全性。