<?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>User First Web &#187; Apache</title>
	<atom:link href="http://userfirstweb.com/category/apache-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://userfirstweb.com</link>
	<description>A blog about putting people before technology</description>
	<lastBuildDate>Thu, 29 Sep 2011 05:39:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Logouts &amp; Form-based HTTP Basic Authentication</title>
		<link>http://userfirstweb.com/23/logouts-form-based-http-basic-authentication/</link>
		<comments>http://userfirstweb.com/23/logouts-form-based-http-basic-authentication/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 22:44:24 +0000</pubDate>
		<dc:creator>Jason Grigsby</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Zope]]></category>

		<guid isPermaLink="false">http://userfirstweb.com/23/logouts-form-based-http-basic-authentication/</guid>
		<description><![CDATA[There are many advantages to HTTP Basic Authentication, but despite these advantages, web developers have turned almost exclusively to using cookie-based authentication because of some limitations in how HTTP Basic Authentication can be implemented. Until recently, there has been no way to for developers to control the login form nor provide a way for users [...]]]></description>
			<content:encoded><![CDATA[<p>There are many advantages to HTTP Basic Authentication, but despite these advantages, web developers have turned almost exclusively to using cookie-based authentication because of some limitations in how HTTP Basic Authentication can be implemented. Until recently, there has been no way to for developers to control the login form nor provide a way for users to log out.</p>
<p>The advantages of using HTTP Basic Authentication are easier integration. In particular, mod_auth_mysql for Apache makes it possible to easily password-protect areas based on usernames, passwords and roles stored in a central authentication database. The main alternative for authentication, cookie-based authentication, provides a higher barrier for integration projects.</p>
<p>Despite the integration advantages, most web developers use cookie-based authentication because they want to control the user experience of logging in. When logging in using HTTP Basic Authentication, the browser shows a login prompt. Developers have no control over the look of this login prompt; therefore, there is no ability to add useful information like links to retrieve forgotten passwords.<br />
<span id="more-23"></span><br />
After several unsuccessful login attempts, HTTP Basic Authentication redirects to a 401 error page. Only at this point can developers provide further instructions to assist the user. And with some browsers (ahem.. Safari), the 401 page will not be rendered if the user cancels their login attempt.</p>
<p>Once someone logs in, there is no way to log them out short of quitting the browser. <a href="http://httpd.apache.org/docs/1.3/howto/auth.html">Apache&#8217;s FAQs</a> provide the best explanation of the limitation:</p>
<blockquote>
<h3>      How do I log out?</h3>
<p>Since browsers first started implementing basic     authentication, website administrators have wanted to know how     to let the user log out. Since the browser caches the username     and password with the authentication realm, as described     earlier in this tutorial, this is not a function of the server     configuration, but is a question of getting the browser to     forget the credential information, so that the next time the     resource is requested, the username and password must be     supplied again. There are numerous situations in which this is     desirable, such as when using a browser in a public location,     and not wishing to leave the browser logged in, so that the     next person can get into your bank account.</p>
<p>However, although this is perhaps the most frequently asked     question about basic authentication, thus far none of the major     browser manufacturers have seen this as being a desirable     feature to put into their products.</p>
<p>Consequently, the answer to this question is, you can&#8217;t.     Sorry.</p></blockquote>
<p>Because my company uses HTTP Basic Authentication, I&#8217;ve become very good at explaining why we can&#8217;t have a form in the web page for logging in and why we can&#8217;t provide a log out button.</p>
<p>A couple of years ago, John Keith (our CTO) and I theorized that if we could log the user into the same realm using credentials that were only valid for a single page that we could mimic log out behavior. We explored trying to set the credentials on the server, but found that this only worked in Apache 2.0.</p>
<p>Basically we hit a brick wall until a couple of months ago. Thankfully, the increased emphasis on web services has caused a resurgence in HTTP Auth interest. If you have a password-protected API, you can&#8217;t assume that the client will accept cookies. In fact, it is unlikely that the client will accept cookies so you have to find an authentication alternative.</p>
<p>We&#8217;ve been experimenting with a new technique that allows for both form-based HTTP Basic Auth login boxes as well as log out buttons. It works using AJAX to take the usernames and passwords from the form and pass log the user in via the XmlHttpRequest object.</p>
<p>A similar technique logs a user out by logging the user into a page with credentials that are only valid for that page. The user never truly logs out, but the effect is the same. Until the user supplies their original credentials, they will be unable to see anything other than the one page.</p>
<p>I&#8217;m pleased to say that we&#8217;re having some success with these techniques and are using them to solve a long-standing customer issue. Details on the technique we&#8217;ve been basing our development on were <a href="http://www.peej.co.uk/articles/http-auth-with-html-forms.html">originally published by Paul James</a>. I highly recommend taking a look at some of Paul&#8217;s other articles on RESTful implementations and HTTP caching.</p>
<p>If you&#8217;re using HTTP Basic Authentication, you should look into these techniques immediately. Your users will thank you for it.</p>
<h3></h3>
]]></content:encoded>
			<wfw:commentRss>http://userfirstweb.com/23/logouts-form-based-http-basic-authentication/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
