Santosh Panda
Santosh Panda

Reputation: 7351

How to restrict WCF methods for specific Windows User Groups?

I have a WCF service hosted in Windows Service, uses secure connection using https. There are two Windows User groups (say Group A and Group B) present on the same machine.

I need few methods can be called by Group A and a few by Group B.

And some methods by both.

I have used the [PrincipalPermissionAttribute] above the methods but it only takes the user role (i.e Administrator or User etc) not for user groups.

Please help me on this.

Upvotes: 1

Views: 951

Answers (1)

marc_s
marc_s

Reputation: 755371

If you're using ClientCredentialType = "Windows" in your service configuration, then your "role" (defined in the [PrincipalPermissionAttribute]) is the Windows group.

See:

WCF Security Guidance by the MS Patterns & Practices group - topic on How do I restrict access to WCF operations to specific Windows users?

Upvotes: 1

Related Questions