<?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>zedia flash blog &#187; twitteroauth</title>
	<atom:link href="http://www.zedia.net/tag/twitteroauth/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Thu, 02 Feb 2012 17:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Playing with OAuth and twitteroauth</title>
		<link>http://www.zedia.net/2010/playing-with-oauth-and-twitteroauth/</link>
		<comments>http://www.zedia.net/2010/playing-with-oauth-and-twitteroauth/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 03:58:26 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tokens]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[twitteroauth]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=660</guid>
		<description><![CDATA[As some of you might know, on August 16th 2010 (it was June 30th at first, but they moved it because of the World cup), Twitter will be shutting down its basic authorization in favor of OAuth. Well Facebook also announced that they would be soon using OAuth. Google and Yahoo! use it too. Looks [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you might know, on <a title="Twitter moving to OAuth" href="http://countdowntooauth.com/" target="_blank">August 16th 2010</a> (it was June 30th at first, but they moved it because of the World cup), <a title="Twitter" href="http://www.twitter.com" target="_blank">Twitter</a> will be shutting down its basic authorization in favor of <a title="OAuth" href="http://oauth.net/" target="_blank">OAuth</a>. Well <a title="Facebook" href="http://www.facebook.com" target="_blank">Facebook</a> also announced that they would be soon using OAuth. <a title="Google" href="http://www.google.com" target="_blank">Google</a> and <a title="Yahoo!" href="http://www.yahoo.com" target="_blank">Yahoo!</a> use it too. Looks like it is a good time to learn it.</p>
<p>OAuth, contrary to what some might say is not that easy of a process. It involves a couple more steps than basic authorization. But what it gains from that is trust. The user never has to enter its username and password on your site. My problem with it is that I find that it breaks the user experience because it usually redirects the user&#8217;s browser to the website of which you want to use the API, so that the user can input its credentials and that they can allow your application to use data from the API. If you are not familiar with OAuth, here is a great <a title="Beginner's guide to OAuth" href="http://hueniverse.com/oauth/" target="_blank">beginner&#8217;s guide</a>.</p>
<p>Here is a picture of all the steps involved in the process:</p>
<p style="text-align: center;"><a href="http://www.zedia.net/wp-content/uploads/2010/06/oauth_diagram.png"><img class="aligncenter size-full wp-image-663" title="oauth_diagram" src="http://www.zedia.net/wp-content/uploads/2010/06/oauth_diagram.png" alt="OAuth process diagram" width="624" height="415" /></a></p>
<p>Now what I wanted to write about was the <a title="twitteroauth library for PHP" href="http://github.com/abraham/twitteroauth" target="_blank">twitteroauth library for PHP</a> by @<a title="Abraham on Twitter" href="http://twitter.com/abraham" target="_blank">abraham</a>. I tried to try the other <a title="Php Oauth Library" href="http://code.google.com/p/oauth-php/" target="_blank">OAuth PHP library</a> that is listed in the <a title="List of OAuth libraries" href="http://dev.twitter.com/pages/oauth_libraries#php" target="_blank">Twitter documentation</a> but I couldn&#8217;t figure out anything; they talk about Two-Legged OAuth and Three-Legged OAuth, but I have never seen that anywhere. twitteroauth on the other hand is pretty simple to understand. By reading the <a title="twitteroauth documentation" href="http://github.com/abraham/twitteroauth/blob/master/DOCUMENTATION" target="_blank">documentation</a> and starting with the example provided in the source code, I was able to implement what I wanted.</p>
<p>Now I wasn&#8217;t the one who created the application on Twitter (which you have to do before you get started with code), so there was a couple of settings that weren&#8217;t right at first. You can set if you want your application to be Read-only or Read  &amp; Write. Obviously if you want to send Tweets using your application, you will need it to be set to Read &amp; Write. Also in order to use this library you must set your application as a Browser application (as opposed to Client which will not work). I just thought it would be good to list those here so that others (and I) don&#8217;t spend the half hour I lost trying to figure this out.</p>
<p>Here is another really interesting tidbit: once you create an authorization token, Twitter will never destroy it. This is not the same for all APIs (I know <a title="Yahoo! API" href="http://developer.yahoo.com/" target="_blank">Yahoo!</a> will expire the token after some time). So once you lead the user through all of the OAuth steps, you can keep the token and use it forever so that the user don&#8217;t have to go through the steps again, which is very useful for mobile and desktop apps. It also opens up possibilities for other stuff too, which I will show you eventually, if my current project ever finishes.</p>
<p>Well that is is for now, there will be more on OAuth soon as my next project also connect to another API that uses OAuth.</p>
 <p><a href="http://www.zedia.net/?flattrss_redirect&amp;id=660&amp;md5=cdede091e3b71e535e9a07a35bc482ec" title="Flattr" target="_blank"><img src="http://www.zedia.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2010/playing-with-oauth-and-twitteroauth/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

