-
Notifications
You must be signed in to change notification settings - Fork 18
Basic Authentication Handler Overview
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].