Authorizing through declarative role-based access control
Role-based authorization is a commonly used access control approach in .NET-based applications. Developers can either use code (programmatically) or apply attributes (declaratively) so as to define particular access control rules on .NET code based on the current security identity principal. For WCF service operations, it also naturally supports role-based authorization and access control, and it is quite straightforward to add declarative style role-based access control over service operations without writing any code.
How to do it...
Here we will go through the steps for applying declarative style role-based access control for WCF service operations.
Choose a proper authentication type for the service.
The first step is choosing a client authentication type for our service operations. We can choose any kind of authentication type as long as it will populate a valid security principal/identity in the server-side service operation context...