开发者

Restricting WCF TCP endpoint to Administrators

开发者 https://www.devze.com 2023-01-29 11:56 出处:网络
How do I restrict access of a remotely-accessible WCF endpoint to a local/domain administrator? Edit: After adding [PrincipalPermission(SecurityAction.Demand, N开发者_运维问答ame = \"AdminUser\")]

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


Edit: After adding [PrincipalPermission(SecurityAction.Demand, N开发者_运维问答ame = "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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消