Using username authentication with an ASP.NET membership provider
WCF supports username authentication, which requires the service caller to supply a username/password token for validation. By default, if we simply turn on username authentication at the message layer, the WCF service runtime will use the Windows SAM
database to validate the username/password credentials. However, we can also use our custom database or account storage to perform the validation, and if you are familiar with ASP.NET web application development, you will find it quite convenient to directly use the ASP.NET membership database for WCF username authentication.
In this recipe, we will show you how to enable username authentication against the ASP.NET membership database for a WCF service. And we will use a web application for hosting our sample WCF service which uses the ASP.NET membership database for username token validation.
How to do it...
Enable an ASP.NET membership provider and user accounts.
The first thing...