<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Connect on Yang's Blog</title><link>https://blog.yangtheman.com/tags/connect/</link><description>Recent content in Connect on Yang's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Yang Chung</copyright><lastBuildDate>Mon, 24 Aug 2009 05:36:59 +0000</lastBuildDate><atom:link href="https://blog.yangtheman.com/tags/connect/index.xml" rel="self" type="application/rss+xml"/><item><title>How to integrate Facebook Connect with a Rails app</title><link>https://blog.yangtheman.com/2009/08/23/how-to-integrate-facebook-connect-with-a-rails-app/</link><pubDate>Mon, 24 Aug 2009 05:36:59 +0000</pubDate><guid>https://blog.yangtheman.com/2009/08/23/how-to-integrate-facebook-connect-with-a-rails-app/</guid><description>&lt;p&gt;&lt;em&gt;Update: I have written up another post for using Devise and Omniauth, and you can find it &lt;a href="http://blog.yangtheman.com/2012/02/09/facebook-connect-with-rails-omniauth-devise/" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;. Facebooker is no longer maintained.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Top of my to-do list was to integrate Facebook Connect with my Rails app, since 1) there are A LOT of people using Facebook and 2) having to register to post or edit could be an obstacle in getting more users to use my site.&lt;/p&gt;
&lt;p&gt;I looked on the web for a while, and found a great example by Stuart Eccles at &lt;a href="http://www.madebymany.co.uk/tutorial-for-restful_authentication-on-rails-with-facebook-connect-in-15-minutes-00523" target="_blank" rel="noreferrer"&gt;Made by Many&lt;/a&gt;. It&amp;rsquo;s an awesome tutorial, but it&amp;rsquo;s for restful_authentication. I don&amp;rsquo;t use it, so I had to modify it a little bit. Also, I added a step to ask a user to pick a username. So the following instruction is basically modification of Stuart&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;Without further ado, let&amp;rsquo;s begin.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Setup Facebook Application page&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.1.&lt;/strong&gt; Go to this &lt;a href="http://www.facebook.com/developers/#/developers/createapp.php" target="_blank" rel="noreferrer"&gt;page&lt;/a&gt;, and enter a name for your application. I named mine &amp;ldquo;Playgrounds_R_Us&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.2.&lt;/strong&gt; Make a note of &lt;strong&gt;Application ID&lt;/strong&gt;, &lt;strong&gt;API Key&lt;/strong&gt;, and &lt;strong&gt;Secret&lt;/strong&gt;. You need it for &lt;strong&gt;facebooker.yml&lt;/strong&gt; later.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.3.&lt;/strong&gt; Next is &lt;strong&gt;Authentication&lt;/strong&gt; section. Here what&amp;rsquo;s important is &lt;strong&gt;Post-Authroize&lt;/strong&gt; and &lt;strong&gt;Post-Remove Callback URL&lt;/strong&gt;. They refer to a web page a user will be taken to after logging into and logging out of Facebook account. While testing, I left it at &amp;ldquo;http://127.0.0.1:3000&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.4.&lt;/strong&gt; I also used the same URL (http://127.0.0.1:3000) for &lt;strong&gt;Canvas Callback URL&lt;/strong&gt; in &lt;strong&gt;Canvas&lt;/strong&gt; section and &lt;strong&gt;Connect URL&lt;/strong&gt; in &lt;strong&gt;Connect&lt;/strong&gt; section.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.5.&lt;/strong&gt; Then you are pretty much set with configuration on Facebook side.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Get &lt;a href="http://github.com/mmangino/facebooker/tree/master" target="_blank" rel="noreferrer"&gt;facebooker&lt;/a&gt; plugin and install it. From your rails app root directory,&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ruby script/plugin install git://github.com/mmangino/facebooker.git&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description></item></channel></rss>