Petrus Theron
Petrus Theron

Reputation: 28866

Restricting WCF TCP endpoint to Administrators

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?

Upvotes: 1

Views: 360

Answers (1)

Simon Mourier
Simon Mourier

Reputation: 139276

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

Upvotes: 1

Related Questions