<?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: Netflix API Authentication with the Ruby Oauth Gem</title>
	<atom:link href="http://mandarinsoda.com/2008/10/19/netflix-authentication-with-ruby-oauth/feed/" rel="self" type="application/rss+xml" />
	<link>http://mandarinsoda.com/2008/10/19/netflix-authentication-with-ruby-oauth/</link>
	<description>Random Musings, Sometimes Programming.</description>
	<lastBuildDate>Fri, 16 Mar 2012 21:41:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Lee</title>
		<link>http://mandarinsoda.com/2008/10/19/netflix-authentication-with-ruby-oauth/comment-page-1/#comment-560</link>
		<dc:creator>Lee</dc:creator>
		<pubDate>Thu, 27 Nov 2008 02:38:32 +0000</pubDate>
		<guid isPermaLink="false">http://mandarinsoda.com/?p=204#comment-560</guid>
		<description>Thanks for this.  It&#039;s helpful.

I&#039;ve got a special problem that I&#039;m stuck on.  My users are not coming in via browser, so I can&#039;t redirect them to get an access_token.  I think I can get them to do this once during registration and then store their access_token for future use.  According to Netflix, it doesn&#039;t expire.

So, I&#039;m trying to figure out how to replace the calls to authorize_url (not needed) and get_access_token with something that I retrieve from my database, associated with the user.

The trouble is that I can&#039;t figure out how to use the library to make this work.  I&#039;ve tried replacing the get_access_token call with the internal constructor it contains for OAuth::AccessToken, but I&#039;m doing something wrong, because my subsequent requests fail with either a 401 Unauthorized or undefined method `[]&#039; for nil:NilClass.

That second error seems to come from the missing access_token.response[:user_id].  But the OAuth::AccessToken constructor didn&#039;t take that as a parameter, so I&#039;m confused by how it gets populated.

Can you enlighten me?  (Sorry for this long comment.  It&#039;s not spam.  :-)</description>
		<content:encoded><![CDATA[<p>Thanks for this.  It&#8217;s helpful.</p>
<p>I&#8217;ve got a special problem that I&#8217;m stuck on.  My users are not coming in via browser, so I can&#8217;t redirect them to get an access_token.  I think I can get them to do this once during registration and then store their access_token for future use.  According to Netflix, it doesn&#8217;t expire.</p>
<p>So, I&#8217;m trying to figure out how to replace the calls to authorize_url (not needed) and get_access_token with something that I retrieve from my database, associated with the user.</p>
<p>The trouble is that I can&#8217;t figure out how to use the library to make this work.  I&#8217;ve tried replacing the get_access_token call with the internal constructor it contains for OAuth::AccessToken, but I&#8217;m doing something wrong, because my subsequent requests fail with either a 401 Unauthorized or undefined method `[]&#8216; for nil:NilClass.</p>
<p>That second error seems to come from the missing access_token.response[:user_id].  But the OAuth::AccessToken constructor didn&#8217;t take that as a parameter, so I&#8217;m confused by how it gets populated.</p>
<p>Can you enlighten me?  (Sorry for this long comment.  It&#8217;s not spam.  <img src='http://mandarinsoda.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

