<?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>Kevin Bedell on Internet Tech &#187; twitter</title>
	<atom:link href="http://www.kbedell.com/category/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kbedell.com</link>
	<description>Discussions on Ruby on Rails, Agile Development and the Boston Tech Scene.</description>
	<lastBuildDate>Mon, 09 Jan 2012 15:40: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>Overriding the OmniAuth callback url for twitter or facebook oath processing.</title>
		<link>http://www.kbedell.com/2011/03/08/overriding-omniauth-callback-url-for-twitter-or-facebook-oath-processing/</link>
		<comments>http://www.kbedell.com/2011/03/08/overriding-omniauth-callback-url-for-twitter-or-facebook-oath-processing/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 19:08:14 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[leanstartup]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[omniauth]]></category>

		<guid isPermaLink="false">http://www.kbedell.com/?p=277</guid>
		<description><![CDATA[A lot of people are now using OmniAuth for Oath processing to connect applications to twitter, facebook, linkedin or any number of other SAAS applications. It&#8217;s easy and it works well. I&#8217;m using it for some work I&#8217;m doing with a client of mine (Practically Green &#8211; a great little eco-startup) and ran into an [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people are now using <a href="https://github.com/intridea/omniauth">OmniAuth</a> for Oath processing to connect applications to twitter, facebook, linkedin or any number of other SAAS applications. It&#8217;s easy and it works well. </p>
<p>I&#8217;m using it for some work I&#8217;m doing with a client of mine (<a href="http://practicallygreen.com">Practically Green</a> &#8211; a great little eco-startup) and ran into an issue with how it created callback url&#8217;s &#8212; the url where the user is redirected after the Oauth authentication is completed. </p>
<p>The issue was with the way our web listeners are proxied back to the rails application servers. Behind the scenes, the rails application servers have a host name of something that&#8217;s not really a valid domain name (say, something like &#8216;railsserver&#8217;).</p>
<p>Omniauth was grabbing this value from the request object and forwarding our users back to an Oauth callback url like &#8216;http://railsservers/auth/twitter/&#8230;&#8217;. Obviously, this isn&#8217;t what we wanted &#8212; the Oauth callbacks were failing.</p>
<p>After digging through the Omniauth code, I ran across the offending piece of code:</p>
<p><code><br />
&nbsp;def full_host<br />
&nbsp;&nbsp;case OmniAuth.config.full_host<br />
&nbsp;&nbsp;&nbsp;when String<br />
&nbsp;&nbsp;&nbsp;&nbsp;OmniAuth.config.full_host<br />
&nbsp;&nbsp;&nbsp;when Proc<br />
&nbsp;&nbsp;&nbsp;&nbsp;OmniAuth.config.full_host.call(env)<br />
&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;uri = URI.parse(request.url.gsub(/\?.*$/,''))<br />
&nbsp;&nbsp;&nbsp;&nbsp;uri.path = ''<br />
&nbsp;&nbsp;&nbsp;&nbsp;uri.query = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;uri.to_s<br />
&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
</code></p>
<p>Basically, if this config paramerter <code>:full_host</code> isn&#8217;t set to either a string or a proc, omniauth pulls the uri from the request object &#8212; this is where it was messing up.</p>
<p>Since the Omniauth config object is a singleton, I just set that parameter in config/initializers/omniauth.rb like so:</p>
<p><code>(in config/initializers/omniauth.rb)<br />
# Set the default hostname for omniauth to send callbacks to.<br />
OmniAuth.config.full_host = "http://practicallygreen.com"<br />
</code></p>
<p>With this, the full_host param is a string and now the redirects are always created to come back to where we want.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kbedell.com/2011/03/08/overriding-omniauth-callback-url-for-twitter-or-facebook-oath-processing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Redswingline twitter bot now active again</title>
		<link>http://www.kbedell.com/2009/02/20/redswingline-stapler-twitter-bot/</link>
		<comments>http://www.kbedell.com/2009/02/20/redswingline-stapler-twitter-bot/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 13:43:03 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[twitter]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.kbedell.com/?p=5</guid>
		<description><![CDATA[Yes, it was me. I created the redswingline stapler twitter bot almost two years ago as a way of experimenting with Twitter and its API. I had been watching the movie Office Space a lot and thought it would be fun to create a twitter avatar of the red swingline stapler that was on Milton&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, it was me.</p>
<p>I created the <a href="http://twitter.com/redswingline" target="_blank">redswingline stapler twitter bot</a> almost two years ago as a way of experimenting with Twitter and its API. I had been watching the movie Office Space a lot and thought it would be fun to create a twitter avatar of the red swingline stapler that was on Milton&#8217;s desk.</p>
<p>Anyway, it was off-line for about a year but I recently started it up again.</p>
<p>I hate to admit, but that stapler has more twitter followers <a href="http://twitter.com/kbedell" target="_blank">than I do</a>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kbedell.com/2009/02/20/redswingline-stapler-twitter-bot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

