<?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: Easy Rails API Authentication Using restful-authentication</title>
	<atom:link href="http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/</link>
	<description>Ruby on Rails web application design, development and consulting</description>
	<lastBuildDate>Tue, 31 Aug 2010 21:37:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Sean</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comment-1084</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Tue, 31 Aug 2010 21:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224#comment-1084</guid>
		<description>Really helpful, thanks!</description>
		<content:encoded><![CDATA[<p>Really helpful, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alican</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comment-170</link>
		<dc:creator>Alican</dc:creator>
		<pubDate>Wed, 21 Oct 2009 09:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224#comment-170</guid>
		<description>Thanks for tutorial, I implemented correctly and working so far but
I can access xmls without api key parameter passed.

I.e
/tasks.xml returning all tasks by XML format (need to asks for api key?)
/tasks.xml?api_key=randomkeyhere returning tasks by XML format normally

How can i restrict respond to xml blocks with only API key.
Regards.</description>
		<content:encoded><![CDATA[<p>Thanks for tutorial, I implemented correctly and working so far but<br />
I can access xmls without api key parameter passed.</p>
<p>I.e<br />
/tasks.xml returning all tasks by XML format (need to asks for api key?)<br />
/tasks.xml?api_key=randomkeyhere returning tasks by XML format normally</p>
<p>How can i restrict respond to xml blocks with only API key.<br />
Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christoph Bünte</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comment-169</link>
		<dc:creator>Christoph Bünte</dc:creator>
		<pubDate>Mon, 24 Aug 2009 09:28:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224#comment-169</guid>
		<description>Thanx for sharing the code, it was pretty useful. But there is a security issue with the login_from_api_key method. The following finder finds a user, but it&#039;s supposed to find none: User.find_by_api_key(&#039;&#039;)

So any user can authenticate itself by leaving the api_key parameter value blank. This is how i do it:

def login_from_api_key
  self.current_user = User.valid.find_by_api_key(params[:api_key]) unless params[:api_key].blank?
end</description>
		<content:encoded><![CDATA[<p>Thanx for sharing the code, it was pretty useful. But there is a security issue with the login_from_api_key method. The following finder finds a user, but it&#8217;s supposed to find none: User.find_by_api_key(&#8221;)</p>
<p>So any user can authenticate itself by leaving the api_key parameter value blank. This is how i do it:</p>
<p>def login_from_api_key<br />
  self.current_user = User.valid.find_by_api_key(params[:api_key]) unless params[:api_key].blank?<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandre Carvalho</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comment-168</link>
		<dc:creator>Alexandre Carvalho</dc:creator>
		<pubDate>Mon, 10 Aug 2009 23:33:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224#comment-168</guid>
		<description>Using:

 ./script/generate controller APIKeys

will give you some trouble because of the rails namings conventions

Use:

./script/generate controller ApiKeys

and you won&#039;t have any problem like the one with the helper.</description>
		<content:encoded><![CDATA[<p>Using:</p>
<p> ./script/generate controller APIKeys</p>
<p>will give you some trouble because of the rails namings conventions</p>
<p>Use:</p>
<p>./script/generate controller ApiKeys</p>
<p>and you won&#8217;t have any problem like the one with the helper.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Stubblebine</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comment-167</link>
		<dc:creator>Tony Stubblebine</dc:creator>
		<pubDate>Fri, 07 Aug 2009 02:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224#comment-167</guid>
		<description>Awesome post. Very helpful. We&#039;re rolling out some code at CrowdVine with this. Having it laid out meant it was easy to squeeze this feature in between other work. Thank you!</description>
		<content:encoded><![CDATA[<p>Awesome post. Very helpful. We&#8217;re rolling out some code at CrowdVine with this. Having it laid out meant it was easy to squeeze this feature in between other work. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maheshbalaji</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comment-166</link>
		<dc:creator>maheshbalaji</dc:creator>
		<pubDate>Fri, 17 Jul 2009 04:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224#comment-166</guid>
		<description>use the above code ( API Authentication Using restful-authentication) but i am facing an 500 error and i have checked my development log it shows the errors like /simpletwitterapp/app/helpers/api_keys_helper.rb to define ApiKeysHelper is there any thing has to define in it</description>
		<content:encoded><![CDATA[<p>use the above code ( API Authentication Using restful-authentication) but i am facing an 500 error and i have checked my development log it shows the errors like /simpletwitterapp/app/helpers/api_keys_helper.rb to define ApiKeysHelper is there any thing has to define in it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avishai</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comment-165</link>
		<dc:creator>Avishai</dc:creator>
		<pubDate>Fri, 05 Jun 2009 16:17:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224#comment-165</guid>
		<description>Very cool. I&#039;ve been working on a similar way to authenticate users to edit stuff they&#039;ve posted to my app, without having to create an account. Turns out you can override the default REST routes to require some kind of token or key to authorize the action:

map.resources :things do &#124;thing&#124;
    map.edit &#039;/things/:id/edit/:verification_code&#039;, :controller =&gt; &quot;posts&quot;, :action =&gt; &quot;edit&quot;
    map.confirm &#039;/things/:id/confirm/:verification_code&#039;, :controller =&gt; &quot;things&quot;, :action =&gt; &quot;confirm&quot;
  end

Works fine in dev, but haven&#039;t really tested it yet.</description>
		<content:encoded><![CDATA[<p>Very cool. I&#8217;ve been working on a similar way to authenticate users to edit stuff they&#8217;ve posted to my app, without having to create an account. Turns out you can override the default REST routes to require some kind of token or key to authorize the action:</p>
<p>map.resources :things do |thing|<br />
    map.edit &#8216;/things/:id/edit/:verification_code&#8217;, :controller =&gt; &#8220;posts&#8221;, :action =&gt; &#8220;edit&#8221;<br />
    map.confirm &#8216;/things/:id/confirm/:verification_code&#8217;, :controller =&gt; &#8220;things&#8221;, :action =&gt; &#8220;confirm&#8221;<br />
  end</p>
<p>Works fine in dev, but haven&#8217;t really tested it yet.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
