Skip to content

Basic Authentication Handler Overview

mikeobrien edited this page Sep 14, 2010 · 3 revisions

WCF REST Contrib ships with the basic authentication handler WcfRestContrib.ServiceModel.Dispatcher.WebBasicAuthenticationHandler. This handler allows you to enable basic authentication on a per service or operation basis. It is implemented independent of IIS so does not require any special web server configuration. The Basic Authentication Handler depends on the WCF REST Contrib WebErrorHandler described [here|WebErrorHandler Overview]. To authenticate using basic authentication follow the steps outlined [here|Web Authentication Overview] but use the WcfRestContrib.ServiceModel.Dispatcher.WebBasicAuthenticationHandler as follows:

Declaratively:

{{
[WebAuthenticationConfiguration(
typeof(WcfRestContrib.ServiceModel.Dispatcher.WebBasicAuthenticationHandler),
typeof(MyApplication.SecurityValidator),
“My Application”)]
public class Books : IBooksService {…}
}}
Or in configuration as a service behavior:

{{



}}
NOTE: The WcfRestContrib.ServiceModel.Web.WebServiceHost allows you to specify configuration based behaviors if you do not want to specify this declaratively. See more about it [here| Declarative Binding & Behavior Overview].

Clone this wiki locally