SHARE:
Uncategorized

Setting Up a Staging Environment to Use OmniAuth Facebook

Flatiron School / 15 November 2012

The following is a guest post by Li Ouyang and originally appeared on her blog. Li is currently a student a The Flatiron School. You can learn more about her here, or follow her on twitter here.

After being fully frustrated with not being able to test my facebook login on my local server, I finally created a staging environment. I am hoping this will be helpful for my front-end developer and mastermind of this particular project as well.

Steps to setting up staging environment

1. Create Heroku Staging App

Here you are creating a staging app with the same addons your production app has. Be sure to add a comma delimited-list of the addons, no whitespaces!

2. Rename to Staging

check to see that you have successfully created your staging app with git remote -v

Let’s change the the staging app’s name and domain to something a little more memorable. Go to your dashboard at Heroku and click on your newly created staging app, in my case, it’s called floating-stream-1039. In Settings, go ahead and change the name.

In your staging-app’s info page on heroku, find the new git url. Copy and paste.Remove the current staging app and add the one with the new name.

3. Create a new Facebook App ID

Go to developers.facebook.com and click on “Create New App.”

4. Add Your New Config Keys

Retrieve your facebook ID and secret codes on developers.facebook.com. Then add them as config keys on heroku. I prefer saving these keys separately from my app’s files.

5. Deploy
6. How I have Omniauth Facebook installed

I used the “omniauth-facebook” gem. Then I created the file config/initializers/omniauth.rb and added the following code.

Hope this is helpful!

How to Use Octokit Commit Method Previous Post Using Polymorphic Associations in Rails pt.1 Next Post