<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Test your django-piston API (with auth)</title>
	<atom:link href="http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/feed/" rel="self" type="application/rss+xml" />
	<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/</link>
	<description>A student&#039;s thoughts on IT</description>
	<lastBuildDate>Thu, 09 Sep 2010 05:57:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
	<item>
		<title>By: Dave Morris</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1467</link>
		<dc:creator>Dave Morris</dc:creator>
		<pubDate>Thu, 04 Feb 2010 00:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1467</guid>
		<description>&lt;p&gt;You are absolutely right. You know what? It turns out that the password field in my fixture was messed up. Not sure how that happened, but it&#039;s working now. Thank you so much for your help.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You are absolutely right. You know what? It turns out that the password field in my fixture was messed up. Not sure how that happened, but it&#39;s working now. Thank you so much for your help.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Morris</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1455</link>
		<dc:creator>Dave Morris</dc:creator>
		<pubDate>Wed, 03 Feb 2010 23:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1455</guid>
		<description>&lt;p&gt;You are absolutely right. You know what? It turns out that the password field in my fixture was messed up. Not sure how that happened, but it&#039;s working now. Thank you so much for your help.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You are absolutely right. You know what? It turns out that the password field in my fixture was messed up. Not sure how that happened, but it&#39;s working now. Thank you so much for your help.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Pelletier</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1454</link>
		<dc:creator>Thomas Pelletier</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1454</guid>
		<description>&lt;p&gt;I think not. Here is the client.get() definition:&lt;br&gt;&lt;br&gt;get(path, data={}, follow=False, **extra)&lt;br&gt;&lt;br&gt;If data is omitted (in yours), it has the same value as mine.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I think not. Here is the client.get() definition:<br /><br />get(path, data={}, follow=False, **extra)<br /><br />If data is omitted (in yours), it has the same value as mine.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Morris</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1453</link>
		<dc:creator>Dave Morris</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1453</guid>
		<description>&lt;p&gt;the only difference I see is in the parameters at the end of the client.get() call:&lt;br&gt;&lt;br&gt;... {}, **self.extra)&lt;br&gt;&lt;br&gt;vs.&lt;br&gt;&lt;br&gt;... HTTP_AUTHORIZATION=&#039;Basic %s&#039; % base64.encodestring(&#039;%s:%s&#039; % (&#039;dave&#039;,&#039;password&#039;)).rstrip())&lt;br&gt;&lt;br&gt;your has the extra {} in there. Does that make a difference?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>the only difference I see is in the parameters at the end of the client.get() call:<br /><br />&#8230; {}, **self.extra)<br /><br />vs.<br /><br />&#8230; HTTP_AUTHORIZATION=&#39;Basic %s&#39; % base64.encodestring(&#39;%s:%s&#39; % (&#39;dave&#39;,&#39;password&#39;)).rstrip())<br /><br />your has the extra {} in there. Does that make a difference?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Pelletier</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1452</link>
		<dc:creator>Thomas Pelletier</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:45:49 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1452</guid>
		<description>&lt;p&gt;Just tested in my local application: both strip and rstrip work.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just tested in my local application: both strip and rstrip work.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Pelletier</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1451</link>
		<dc:creator>Thomas Pelletier</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:45:06 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1451</guid>
		<description>&lt;p&gt;This code does the same thing as mine, but it uses rstrip() insead of strip(). I&#039;m not sure how it can impact on the result, yet try to change strip() to rstrip() in my code, and see if it works.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This code does the same thing as mine, but it uses rstrip() insead of strip(). I&#39;m not sure how it can impact on the result, yet try to change strip() to rstrip() in my code, and see if it works.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Morris</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1450</link>
		<dc:creator>Dave Morris</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:35:25 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1450</guid>
		<description>&lt;p&gt;I got some help from the django-piston google group, and it looks like this works:&lt;br&gt;&lt;br&gt;response = self.client.get(&#039;/api/stuff/&#039;, HTTP_AUTHORIZATION=&#039;Basic %s&#039; % base64.encodestring(&#039;%s:%s&#039; % (&#039;dave&#039;,&#039;password&#039;)).rstrip())&lt;br&gt;&lt;br&gt;which doesn&#039;t match what your code does above. Any ideas why this way works for me and not your way?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I got some help from the django-piston google group, and it looks like this works:<br /><br />response = self.client.get(&#39;/api/stuff/&#39;, HTTP_AUTHORIZATION=&#39;Basic %s&#39; % base64.encodestring(&#39;%s:%s&#39; % (&#39;dave&#39;,&#39;password&#39;)).rstrip())<br /><br />which doesn&#39;t match what your code does above. Any ideas why this way works for me and not your way?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: kizlum</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1449</link>
		<dc:creator>kizlum</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:32:43 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1449</guid>
		<description>&lt;p&gt;Yes, it looks like there is a problem in your configuration of your Piston auth backend (often set in urls.py). Paste your file here to see if we can fix it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, it looks like there is a problem in your configuration of your Piston auth backend (often set in urls.py). Paste your file here to see if we can fix it.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Morris</title>
		<link>http://thomas.pelletier.im/2009/12/test-your-django-piston-api-with-auth/comment-page-1/#comment-1448</link>
		<dc:creator>Dave Morris</dc:creator>
		<pubDate>Wed, 03 Feb 2010 18:11:46 +0000</pubDate>
		<guid isPermaLink="false">http://thomas.pelletier.im/?p=450#comment-1448</guid>
		<description>&lt;p&gt;When I try to use this method of http authentication in a unit test against a django-piston api, I receive the following error message:&lt;br&gt;&lt;br&gt;.../piston/authentication.py&quot;, line 56, in is_authenticated&lt;br&gt;    request.user = self.auth_func(username=username, password=password) &lt;br&gt;.../django/contrib/auth/&lt;strong&gt;init&lt;/strong&gt;.py&quot;, line 36, in authenticate&lt;br&gt;    user = backend.authenticate(**credentials)&lt;br&gt;.../django/contrib/auth/backends.py&quot;, line 19, in authenticate&lt;br&gt;    if user.check_password(password):&lt;br&gt;.../django/contrib/auth/models.py&quot;, line 197, in check_password&lt;br&gt;    return check_password(raw_password, self.password)&lt;br&gt;.../django/contrib/auth/models.py&quot;, line 53, in check_password&lt;br&gt;    algo, salt, hsh = enc_password.split(&#039;$&#039;)&lt;br&gt;ValueError: need more than 2 values to unpack&lt;br&gt;&lt;br&gt;Could this be related to the realm setting in my piston urls.py file?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>When I try to use this method of http authentication in a unit test against a django-piston api, I receive the following error message:<br /><br />&#8230;/piston/authentication.py&#8221;, line 56, in is_authenticated<br />    request.user = self.auth_func(username=username, password=password) <br />&#8230;/django/contrib/auth/<strong>init</strong>.py&#8221;, line 36, in authenticate<br />    user = backend.authenticate(**credentials)<br />&#8230;/django/contrib/auth/backends.py&#8221;, line 19, in authenticate<br />    if user.check_password(password):<br />&#8230;/django/contrib/auth/models.py&#8221;, line 197, in check_password<br />    return check_password(raw_password, self.password)<br />&#8230;/django/contrib/auth/models.py&#8221;, line 53, in check_password<br />    algo, salt, hsh = enc_password.split(&#39;$&#39;)<br />ValueError: need more than 2 values to unpack<br /><br />Could this be related to the realm setting in my piston urls.py file?</p>]]></content:encoded>
	</item>
</channel>
</rss>
