Hosting a WCF service using Basic Authentication

In previous sections, we learned the basic concepts and theories about WCF security. Now, we will do some practical work. We will host a WCF service with Basic Authentication and then consume this service in a client application.

Since with Basic Authentication, username and password are transmitted in Base64 encoded text, SSL will be configured with this authentication mode to enhance the security of the service.

To keep the code simple and focus only on the security side of the WCF service, HelloWorldService and HelloWorldClient will be used for this practice.

Setting up the service

First, we will set up a copy of HelloWorldService with no authentication. We will enhance this service in the following ...

Get WCF 4.5 Multi-Layer Services Development with Entity Framework now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.