Restricting WCF TCP endpoint to Administrators

筅森魡賤 提交于 2019-12-11 09:48:12

问题


How do I restrict access of a remotely-accessible WCF endpoint to a local/domain administrator?


Edit: After adding [PrincipalPermission(SecurityAction.Demand, Name = "AdminUser")] to my WCF channel method implementation, trying to call the service method from my client throws a SecurityAccessDeniedException, which is progress.

How do I let Windows prompt the user for new user details (or a security token) so I can reinitiate the WCF connection as the correct user?


回答1:


You can do this with the PrincipalPermissionAttribute added to the methods declared in your WCF service.

See this link: How to: Restrict Access with the PrincipalPermissionAttribute Class



来源:https://stackoverflow.com/questions/4399716/restricting-wcf-tcp-endpoint-to-administrators

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!