<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Emmer Inc &#187; authentication</title>
	<atom:link href="http://blog.emmerinc.be/index.php/tag/authentication/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.emmerinc.be</link>
	<description>Tales from a .NET developer who's making the jump to the iPhone &#38; App Store wonderland.</description>
	<lastBuildDate>Wed, 23 Jun 2010 20:57:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Basic authentication of a .NET REST service</title>
		<link>http://blog.emmerinc.be/index.php/2009/07/28/basic-authentication-of-a-net-rest-service/</link>
		<comments>http://blog.emmerinc.be/index.php/2009/07/28/basic-authentication-of-a-net-rest-service/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 17:07:36 +0000</pubDate>
		<dc:creator>Yannick Compernol</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WCF REST Contrib]]></category>

		<guid isPermaLink="false">http://blog.emmerinc.be/?p=566</guid>
		<description><![CDATA[One of the issues one can encounter when building a REST service with the .NET Framework 3.5 SP1 is the fact that when basic authentication is enabled, it defaults to authentication against Windows accounts in IIS. It&#8217;s not possible to specify your own handler/provider to authenticate against for instance a proprietary user database, nor is [...]]]></description>
			<content:encoded><![CDATA[<p>One of the issues one can encounter when building a REST service with the .NET Framework 3.5 SP1 is the fact that when basic authentication is enabled, it defaults to authentication against Windows accounts in IIS. It&#8217;s not possible to specify your own handler/provider to authenticate against for instance a proprietary user database, nor is it possible to secure only a certain operation/service and leave the others unsecured.</p>
<p>Luckily there&#8217;s a open source project hosted on <a href="http://www.codeplex.com/">CodePlex </a> called <a href="http://wcfrestcontrib.codeplex.com/">WCF REST Contrib</a> which, besides adding a whole lot of other improvements, solves the aforementioned issues. The project provides a sample solution showcasing all the features, which might seem a bit overwhelming since it includes quite some configuration. I have attached a sample project with only the bare minimum configuration (using attributes) to enable per operation authentication. </p>
<p>Browse to CancerService.svc/request/skincancer to test the authentication, the browser should display a prompt asking for a username and password. The username is &#8220;tony&#8221; and password &#8220;clifton&#8221;. Don&#8217;t mind the rather questionable service and operation name, I had no inspiration at the time.</p>
<p>The original documentation failed to mention that the per operation/service authentication depended on the WebErrorHandler, which has been corrected.</p>
<p>Attachment: <a href='http://blog.emmerinc.be/wp-content/uploads/2009/07/AuthenticationTryout.zip'>Authentication Tryout</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.emmerinc.be/index.php/2009/07/28/basic-authentication-of-a-net-rest-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
