<?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>140dev &#187; Twitter OAuth</title>
	<atom:link href="http://140dev.com/twitter-api-programming-blog/category/twitter-oauth/feed/" rel="self" type="application/rss+xml" />
	<link>http://140dev.com</link>
	<description>Twitter API Programming Tips, Tutorials, Source Code Libraries and Consulting</description>
	<lastBuildDate>Wed, 31 Jul 2019 10:03:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6</generator>
		<item>
		<title>New SSL Certificates are not a problem for anyone using the 140dev code</title>
		<link>http://140dev.com/twitter-api-programming-blog/new-ssl-certificates-are-not-an-problem-for-anyone-using-the-140dev-code/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/new-ssl-certificates-are-not-an-problem-for-anyone-using-the-140dev-code/#comments</comments>
		<pubDate>Wed, 20 Nov 2013 01:49:04 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Phirehose]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=2461</guid>
		<description><![CDATA[Twitter posted a notice today about the need for new SSL certificates: At the end of 2013, all Browsers and Certificate Authorities will no longer support 1024 bits RSA certificates to be compliant to National Institute of Standards and Technology (NIST) guidelines [1]. The SSL certificate currently used on api.twitter.com is signed with the older [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>Twitter posted a <a href="https://dev.twitter.com/blog/rest-api-ssl-certificate-updates">notice</a> today about the need for new SSL certificates:</p>
<blockquote><p>At the end of 2013, all Browsers and Certificate Authorities will no longer support 1024 bits RSA certificates to be compliant to National Institute of Standards and Technology (NIST) guidelines [1].</p>
<p>The SSL certificate currently used on api.twitter.com is signed with the older Verisign G2 root CA certificate.</p>
<p>Due to NIST guidelines, api.twitter.com will change to a new certificate on Dec 10th, 2013. The new certificate will be signed with VeriSign Class 3 Secure Server CA &#8211; G3, which has the 2048 bits key length needed to meet recommended security levels.</p>
<p>This means that all HTTP clients used by your application must trust the new root certificate, otherwise you won&#8217;t be able to connect in the API. To ensure proper SSL certificate verification across all of Twitter&#8217;s services, your software should include all Verisign Root Certificates in its CAFile or other respective keystore. The root certificates are available at the following link:<br />
* Verisign (https://www.symantec.com/page.jsp?id=roots)
</p></blockquote>
<p>I have to admit here that I don&#8217;t really know what an SSL certificate is. I know that it is a file that allows SSL to work, but beyond that my perception of this announcement was like Bart Simpson&#8217;s dog:</p>
<blockquote><p>Blah blah blah Dec 10th blah blah everything breaks blah blah.
</p></blockquote>
<p>What I could tell was that I might need to download something and warn everyone using my code to do the same. So I immediately sent queries to the authors of Phirehose and tmhOAuth, the two libraries upon which all my Twitter code depends. The responses were that we are all good, and I could just ignore this cryptic, yet frightening warning.  </p>
<p>Fenn Bailey, author of Phirehose, replied:</p>
<blockquote><p>Phirehose has no visibility of SSL itself but simply uses PHP (and your OS&#8217;s) SSL layer. Basically, if PHP will work with these new certificates, Phirehose will.</p></blockquote>
<p>And Matt Harris, author of tmhOAuth, said:</p>
<blockquote><p>If you use the included cacert.pem you&#8217;ll be using the same SSL CA roots that Mozilla uses as of Sat Dec 29 20:03:40 2012 (the latest version) &#8212; so things should be fine.</p></blockquote>
<p>Hooray! Everything is good. Nothing to worry about. If you were as mystified as me by the SSL certificate announcement, you can relax. </p>
<p>On a personal level, this lack of understanding of the layers beneath the code that I produce is like the perception of other scientific disciplines when I was in college. I was an organic chemistry major, and we used to laugh at the molecular biology majors, because they didn&#8217;t have good enough memories to hack Organic Chem. The physical chemists used to laugh at us, because we couldn&#8217;t handle the math to understand Pchem. The physicists laughed at the physical chemists, because they couldn&#8217;t base all their work on Quantum Theory. Who knows what the mathematicians thought of the physicists. </p>
<p>Modern Web development has so many moving parts and layers in its software stack that you just have to trust that the guys building the parts your code rests on know what they are doing. I just wish that the Twitter folks understood that many of their 3rd party devs are not CS majors, and yet we are able to build lots of cool apps. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/new-ssl-certificates-are-not-an-problem-for-anyone-using-the-140dev-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting the 140dev Twitter Framework to use OAuth and API 1.1</title>
		<link>http://140dev.com/twitter-api-programming-blog/converting-the-140dev-twitter-framework-to-use-oauth-and-api-1-1/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/converting-the-140dev-twitter-framework-to-use-oauth-and-api-1-1/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 23:48:55 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[Streaming API]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=2041</guid>
		<description><![CDATA[Twitter has announced that they will be turning off basic authentication for the Streaming API on May 7th. I&#8217;m preparing a new version of the 140dev Framework to use OAuth now, and will have it posted tomorrow. That will be good for new users of this code, but if you already have the code in [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>Twitter has announced that they will be turning off basic authentication for the Streaming API on May 7th. I&#8217;m preparing a new version of the 140dev Framework to use OAuth now, and will have it posted tomorrow. That will be good for new users of this code, but if you already have the code in production, I assume you have made changes to it. Here is a detailed set of instructions for modifying an existing installation to use OAuth. The good thing is that you only have to use single-user OAuth, which is pretty easy to implement. These notes should give you everything you need.</p>
<p>Obvious, but very IMPORTANT note: Make a complete backup of any current version of this code you now have in production before making these changes.</p>
<p>There are 5 steps you have to follow to convert an existing installation of this code to use OAuth with the streaming API version 1.1. </p>
<p>1. Create a Twitter application at <a href="http://dev.twitter.com">http://dev.twitter.com</a>, and get a complete set of tokens. If you haven&#8217;t created an app before, you will find detailed instruction in my <a href="http://140dev.com/twitter-api-programming-blog/twitter-api-ebook-single-user-twitter-oauth-programming/">free ebook</a>. </p>
<p>You need 4 tokens as defined on the details page of the application settings:<br />
Consumer Key<br />
Consumer Secret<br />
Access Token<br />
Access Token Secret</p>
<p>It is traditional to rename these tokens in every library that uses them. This has happened again with the Phirehose OAuth library. Here are the new names:<br />
Consumer Key = TWITTER_CONSUMER_KEY<br />
Consumer Secret = TWITTER_CONSUMER_SECRET<br />
Access Token = OAUTH_TOKEN<br />
Access Token Secret = OAUTH_SECRET</p>
<p>2. Modify the 140dev_config.php file in the 140dev Framework code. This is found in /db/140dev_config.php. </p>
<p>You need to replace these lines of code:<br />
// Basic authorization settings for connecting to the Twitter streaming API<br />
// Fill in the values for a valid Twitter account<br />
define(&#8216;STREAM_ACCOUNT&#8217;, &#8216;*****&#8217;);<br />
define(&#8216;STREAM_PASSWORD&#8217;, &#8216;*****&#8217;);</p>
<p>With these new lines. Insert the actual tokens you received from Twitter in step 1:<br />
// OAuth settings for connecting to the Twitter streaming API<br />
// Fill in the values for a valid Twitter app<br />
define(&#8216;TWITTER_CONSUMER_KEY&#8217;,'******&#8217;);<br />
define(&#8216;TWITTER_CONSUMER_SECRET&#8217;,'******&#8217;);<br />
define(&#8216;OAUTH_TOKEN&#8217;,'******&#8217;);<br />
define(&#8216;OAUTH_SECRET&#8217;,'******&#8217;);</p>
<p>3. Get new copies of the Phirehose library code. You need to delete Phirehose.php in your current installation. It will be found in the /libraries/phirehose/ directory. Then download these files and place them in the /libraries/phirehose/ directory:<br />
<a href="https://github.com/fennb/phirehose/blob/master/lib/Phirehose.php">Phirehose.php</a><br />
<a href="https://github.com/fennb/phirehose/blob/master/lib/OauthPhirehose.php">OauthPhirehose.php</a></p>
<p>4. The latest version of Phirehose.php still points to the 1.0 version of the streaming API. To point to version 1.1, you need to change line 20 of Phirehose.php from this:<br />
  const URL_BASE = &#8216;https://stream.twitter.com/1/statuses/&#8217;;</p>
<p>To this:<br />
  const URL_BASE  = &#8216;https://stream.twitter.com/1.1/statuses/&#8217;;</p>
<p>5. The final step is modifying your copy of get_tweets.php, which is found in /db/get_tweets.php. There are two code changes:</p>
<p>First replace these lines starting at line 13:<br />
// Extend the Phirehose class to capture tweets in the json_cache MySQL table<br />
require_once(CODE_DIR . &#8216;libraries/phirehose/phirehose.php&#8217;);<br />
class Consumer extends Phirehose</p>
<p>With these new lines:<br />
require_once(CODE_DIR . &#8216;libraries/phirehose/Phirehose.php&#8217;);<br />
require_once(CODE_DIR . &#8216;libraries/phirehose/OauthPhirehose.php&#8217;);<br />
class Consumer extends OauthPhirehose</p>
<p>Then replace this line:<br />
$stream = new Consumer(STREAM_ACCOUNT, STREAM_PASSWORD, Phirehose::METHOD_FILTER);</p>
<p>With this one:<br />
$stream = new Consumer(OAUTH_TOKEN, OAUTH_SECRET, Phirehose::METHOD_FILTER);</p>
<p>Once you have made all these changes, you need to test out your code. Running the new code in the background with nohup is not an effective test method, since you can&#8217;t see the errror messages. To test the code, I would log into the directory with get_tweets.php and run it directly with:<br />
php get_tweets.php</p>
<p>If it works, you will not see any error codes and data will flow into json_cache.php. Relive the thrill of when that first happened for you. </p>
<p>If it doesn&#8217;t work, there are a couple of things to try:<br />
- Make sure all your paths are correct.<br />
- Make sure you copied your OAuth tokens correctly into the config file.<br />
- Make sure you downloaded a clean set of files from GitHub for Phirehose. It is very common to get HTML in the downloaded files by mistake. </p>
<p>If all else fails, I find cursing helps at this point. When you calm down, post a message at our <a href="https://groups.google.com/forum/?fromgroups#!forum/140dev-twitter-framework">Google Group</a>, and I&#8217;ll try to help. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/converting-the-140dev-twitter-framework-to-use-oauth-and-api-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Most common Twitter OAuth programming errors</title>
		<link>http://140dev.com/twitter-api-programming-blog/most-common-twitter-oauth-programming-errors/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/most-common-twitter-oauth-programming-errors/#comments</comments>
		<pubDate>Sat, 26 Jan 2013 14:31:19 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[API error]]></category>
		<category><![CDATA[Twitter API Tutorials]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=1992</guid>
		<description><![CDATA[My Twitter OAuth ebook has been out for 2 weeks now, and I&#8217;ve had a chance to help a lot of people get over the hump of running their first OAuth code. I&#8217;ve collected a list of the most common problems they have: No callback URL When you create an app, Twitter has an input [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>My <a href="http://140dev.com/twitter-api-programming-blog/twitter-api-ebook-single-user-twitter-oauth-programming/">Twitter OAuth ebook</a> has been out for 2 weeks now, and I&#8217;ve had a chance to help a lot of people get over the hump of running their first OAuth code. I&#8217;ve collected a list of the most common problems they have:</p>
<p><strong>No callback URL</strong><br />
When you create an app, Twitter has an input field on the application creation page for filling in a callback URL. The URL is used when you create an OAuth login interface that lets people sign in on your site with Twitter. So if you are doing single-user OAuth, you could reasonably think that you can leave this blank. Twitter encourages this thinking by not requiring you to fill in the field on this form. The notes under the field also imply that you don&#8217;t need it: &#8220;To restrict your application from using callbacks, leave this field blank.&#8221; I&#8217;m not sure what this note means, but I do know that you MUST include a callback URL. If you don&#8217;t, the tmhOAuth library will not be able to make an OAuth connection and none of your API code will work. What URL should you use? It doesn&#8217;t matter, as long as it is valid. You can even use http://twitter.com. </p>
<p><strong>Failure to set read write access</strong><br />
The Settings tab in the app creation page has a set of radio buttons that let you set the access level to read write. For some reason, this option is not displayed when you first create an app. You have to create the app, which is set to read only access by default, and then go to the Settings tab and change the access to read write. If you leave it as read only, you will not be able to tweet, follow, or do anything else with the API that changes an account. </p>
<p><strong>Incorrect server clock</strong><br />
The OAuth system is very sensitive to differences between Twitter server clocks and your server. If your server&#8217;s clock is off by more than 5 or 10 minutes, all your OAuth requests will fail. If you don&#8217;t know how to check or set your server clock, ask your webhost. </p>
<p><strong>Duplicate tweet</strong><br />
Some people have tried running my example post_tweet.php script and got a 403 error. This generally means that you have sent a duplicate tweet. There is a time limit after which duplicate tweets are allowed, but I&#8217;ve never been able to get an answer from Twitter HQ on what it is. If you get a 403 error when posting a tweet with the API, check your timeline to make sure this is not a duplicate of what you have already sent recently. </p>
<p><strong>tmhOAuth files not found</strong><br />
There are only 2 files from the tmhOAuth files that you must use: cacert.pem and tmhOAuth.php. They both MUST be in the same directory and you have to use a valid path when you require or include tmhOAuth.php. </p>
<p><strong>Invalid tmhOAuth files</strong><br />
I include the latest copies of the tmhOAuth files in the zip for the ebook, but some people prefer to download them from their home site at <a href="https://github.com/themattharris/tmhOAuth">https://github.com/themattharris/tmhOAuth</a>. That is fine, but you have to make sure you download clean copies of these files. I worked with someone for quite a while until we figured out that he had downloaded the entire page from Github, including the HTML, when he downloaded them. </p>
<p>I&#8217;m still interested in hearing about any problems you have with the ebook code. I want to make sure this is as clean as possible. <a href="mailto:140dev@gmail.com">Email me</a> if you can&#8217;t get it to work. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/most-common-twitter-oauth-programming-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Twitter API Console tool</title>
		<link>http://140dev.com/twitter-api-programming-blog/new-twitter-api-console-tool/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/new-twitter-api-console-tool/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 18:10:35 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[Twitter API Console]]></category>
		<category><![CDATA[Twitter API Tutorials]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=1943</guid>
		<description><![CDATA[My Twitter OAuth ebook closes with the source code for an API Console application. This app got such a favorable response that I decided to enhance it and put it out as a free tool. I have found this to be an invaluable debugging aid when testing an API request. It lets you enter just [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>My <a href="http://140dev.com/twitter-api-programming-blog/twitter-api-ebook-single-user-twitter-oauth-programming/">Twitter OAuth ebook</a> closes with the source code for an API Console application. This app got such a favorable response that I decided to enhance it and put it out as a <a href="http://140dev.com/twitter-api-console/">free tool</a>. I have found this to be an invaluable debugging aid when testing an API request. It lets you enter just the description of the request and quickly see the complete response without having to write any test code.</p>
<p style="text-align: center;"><a href="http://140dev.com/twitter-api-console"><img class="aligncenter" style="border: 1px solid black;" title="Twitter API console" src="/blog_images/console.png" alt="" width="400" height="448" /></a></p>
<p>The tool is pretty obvious to use, but I also added a <a href="http://140dev.com/download/140dev_api_console_users_guide.pdf">users guide</a> to cover some of the features you might not notice, such as the ability to share the <a href="http://140dev.com/twitter-api-console/?method=GET&amp;url=1.1/show/users&amp;screen_name=justinbieber">URL </a>for an API request. This lets you easily demonstrate a bug in the API to Twitter HQ, or show a fellow developer how to do a specific API task.</p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/new-twitter-api-console-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting email addresses from OAuth login</title>
		<link>http://140dev.com/twitter-api-programming-blog/getting-email-addresses-from-oauth-login/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/getting-email-addresses-from-oauth-login/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 14:44:43 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[Email collection]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=1896</guid>
		<description><![CDATA[For years now there has been a steady stream of requests, demands, pleas, and threats over the issue of getting user email addresses from the Twitter API. This thread is just one of many on the subject. The simple fact is that it ain&#8217;t gonna happen. No way, not ever. It&#8217;s pretty funny to see [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>For years now there has been a steady stream of requests, demands, pleas, and threats over the issue of getting user email addresses from the Twitter API. This <a href="https://dev.twitter.com/discussions/4019">thread</a> is just one of many on the subject. The simple fact is that it ain&#8217;t gonna happen. No way, not ever. It&#8217;s pretty funny to see how angry devs get when they discover this. The better part is the reasons they give for having to get these addresses. They just want to get to know their users better. </p>
<p>It&#8217;s hard to say never when it comes to Twitter&#8217;s decision making process, but on this issue, I think never is never. Just give it up guys. </p>
<p>The solution is easy. If you want to get a user&#8217;s email address, just ask for it. We do that for this site, and get a pretty good response. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/getting-email-addresses-from-oauth-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Picking up the pieces after 1.1 breaks client-side code</title>
		<link>http://140dev.com/twitter-api-programming-blog/picking-up-the-pieces-after-1-1-breaks-client-side-code/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/picking-up-the-pieces-after-1-1-breaks-client-side-code/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 12:20:56 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[JS coding for Twitter]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=1891</guid>
		<description><![CDATA[I&#8217;ve been having some Twitter discussions with devs about the breakage version 1.1 will cause for client-side Twitter apps. The simplest way to say it is that every page that uses direct Javascript calls to the Twitter API will break when version 1.0 is turned off in March. The only way you will be able [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>I&#8217;ve been having some Twitter discussions with devs about the breakage version 1.1 will cause for client-side Twitter apps. The simplest way to say it is that every page that uses direct Javascript calls to the Twitter API will break when version 1.0 is turned off in March. The only way you will be able to call the API will be with OAuth tokens. That is true for *ALL* API calls, even search. I don&#8217;t think people realize this yet, but they will when the switch to 1.1 happens. </p>
<p>So does this mean that Twitter development is done, and devs will just move elsewhere? No way. Devs go where the customers are, and the customers are using Twitter in increasing numbers. I do development as a business and as a businessman, I go where the money is. That is still Twitter. </p>
<p>The reality is that adapting to version 1.1 is not a big deal. The real change for client-side developers is that they will have to call their server with the API request, and let it call Twitter and return the results. In the end, the JS code is still making an Ajax request to a server and getting back JSON. The only difference will be that the server they call is one they control instead of calling Twitter&#8217;s API servers. Not a huge difference. Not enough to make devs leave all these users behind or give up coding. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/picking-up-the-pieces-after-1-1-breaks-client-side-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter API Ebook: Single-user Twitter OAuth Programming</title>
		<link>http://140dev.com/twitter-api-programming-blog/twitter-api-ebook-single-user-twitter-oauth-programming/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/twitter-api-ebook-single-user-twitter-oauth-programming/#comments</comments>
		<pubDate>Fri, 11 Jan 2013 22:41:31 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[Twitter API Tutorials]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=1825</guid>
		<description><![CDATA[This free ebook covers everything you need to use OAuth from a single Twitter account. It is available as a free PDF download on our members page. You can also get the source code for all the examples in the ebook there as well. Here are the topics covered: Create your first Twitter application Set [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p><a href="/member"><img class="alignleft" src="/blog_images/oauth_ebook_cover_small.png" alt="" width="200" height="251" /></a> This free ebook covers everything you need to use OAuth from a single Twitter account. It is available as a <a href="/member">free PDF download on our members page</a>. You can also get the source code for all the examples in the ebook there as well.  </p>
<p>Here are the topics covered:</p>
<ul>
<li>Create your first Twitter application</li>
<li>Set up OAuth tokens for single-user access</li>
<li>Connect to the Twitter API with the tmhOAuth library</li>
<li>Posting tweets through the API</li>
<li>Looking up complete account details for any Twitter user</li>
<li>Converting Twitter API docs into working PHP code</li>
<li>Debug and test any API request with your own API console</li>
</ul>
<p>I&#8217;ve also created a new <a href="https://groups.google.com/d/forum/140dev-oauth-discussion">Google Group</a> for questions and discussions of the issues raised by this ebook. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/twitter-api-ebook-single-user-twitter-oauth-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OAuth without the dance</title>
		<link>http://140dev.com/twitter-api-programming-blog/oauth-without-the-dance/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/oauth-without-the-dance/#comments</comments>
		<pubDate>Sat, 14 Jul 2012 00:23:01 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[Apps in Tweets]]></category>
		<category><![CDATA[The future of Twitter]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=1672</guid>
		<description><![CDATA[One benefit of running an app within Twitter.com is that it will eliminate the need for the OAuth dance. That is the complex exchange that goes on between a website and the Twitter API when the user logs into Twitter through the website. This communication is necessary to deliver a set of authorization keys that [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>One benefit of running an app within Twitter.com is that it will eliminate the need for the OAuth dance. That is the complex exchange that goes on between a website and the Twitter API when the user logs into Twitter through the website. This communication is necessary to deliver a set of authorization keys that can be used by the site to get the Twitter account information for the user. </p>
<p>You&#8217;ve seen this dance before, even if you didn&#8217;t realize exactly what was happening. You are on a website, and see a button that says <img src="/blog_images/sign-in-with-twitter.png">. Clicking that button takes you to a Twitter controlled page where you can give permission for the site that sent you there to operate on your behalf. When you then give permission, you are sent back to the site to continue where you left off. This whole procedure confuses both the user and the developer who has to implement it. One way of measuring how big a hurdle this is for Twitter API developers is the fact that my <a href="http://140dev.com/twitter-api-programming-tutorials/hello-twitter-oauth-php/">tutorial on using OAuth</a> is the number one visited page on this site. It gets about 30% of all of my site traffic, even though it was written 2 years ago. There is no doubt that the OAuth dance is a pain for everyone involved. </p>
<p>As part of making it possible for developers to run apps within tweets, Twitter will have the chance to streamline this whole process. The Twitter page will already know who the logged in user is. It is just a matter of making this available to the application code running within the tweet.</p>
<p>There are several possible to ways to implement an API that passes this info. I can&#8217;t predict exactly how this will be done, but I am sure it will have to be done. Think about what would happen otherwise. A user who is logged into Twitter sees an app in a tweet, and tries to interact with it. Will Twitter then send that user to another sign-in page to log in again? That makes no sense. There will have to be a transparent way to let the app discover who the current user is. </p>
<p>Explicit authorization by the user will still be necessary before the app can change the user&#8217;s Twitter account or tweet on their behalf, but the UI for that will also have to be handled by Twitter. Otherwise the clean and consistent experience Twitter is striving for will not be achieved. I handle UI issues like this all the time in the website apps I build for clients. I&#8217;m sure Twitter can figure out how to make it happen. They have no choice. </p>
<p>Putting these implementation details aside, the real take away is that apps within tweets will be easier to build and easier for users to interact with. That has to be good for everyone involved, and result in increased adoption and production of Twitter apps. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/oauth-without-the-dance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The simplest Twitter OAuth tutorial possible</title>
		<link>http://140dev.com/twitter-api-programming-blog/the-simplest-twitter-oauth-tutorial-possible/</link>
		<comments>http://140dev.com/twitter-api-programming-blog/the-simplest-twitter-oauth-tutorial-possible/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 01:25:25 +0000</pubDate>
		<dc:creator>Adam Green</dc:creator>
				<category><![CDATA[Automated Tweets]]></category>
		<category><![CDATA[Custom Twitter Client]]></category>
		<category><![CDATA[Twitter API Tutorials]]></category>
		<category><![CDATA[Twitter OAuth]]></category>

		<guid isPermaLink="false">http://140dev.com/?p=994</guid>
		<description><![CDATA[There is something about OAuth that brings out the worst in techies. You can see it when someone asks how to get started with OAuth on the Twitter development talk mailing list. The general response is &#8220;get a copy of library X, and you&#8217;re all set.&#8221; Well if downloading a library would solve the problem, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p></p><p>There is something about OAuth that brings out the worst in techies. You can see it when someone asks how to get started with OAuth on the <a href="http://groups.google.com/group/twitter-development-talk">Twitter development talk</a> mailing list. The general response is &#8220;get a copy of library X, and you&#8217;re all set.&#8221; Well if downloading a library would solve the problem, I don&#8217;t think so many people would keep asking for help. </p>
<p>The disconnect is that all the Twitter docs on OAuth assume that you already know how it works. It&#8217;s like giving driving directions to someone who does not know how to operate a car. If someone has never driven before, saying &#8220;Just go north 5 miles, and you&#8217;re all set&#8221; doesn&#8217;t help much.</p>
<p>What OAuth beginners need is a step by step set of instructions that starts by showing where all the moving parts are, and how to assemble them for a first working program that controls the Twitter API. That is what I have tried to do with my latest tutorial. It is called <a href="http://140dev.com/twitter-api-programming-tutorials/hello-twitter-oauth-php/">Hello Twitter OAuth</a>, and it shows every step necessary to post tweets with OAuth. These techniques can then be applied to any API command. </p>
]]></content:encoded>
			<wfw:commentRss>http://140dev.com/twitter-api-programming-blog/the-simplest-twitter-oauth-tutorial-possible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
