Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Doubt with, Facebook omni-auth


  • Please log in to reply
1 reply to this topic

#1 AnuRuby

AnuRuby

    Passenger

  • Members
  • 1 posts

Posted 08 March 2014 - 05:58 AM

Hey Everyone, 

 

 I have a doubt, with reagrds to integrating facebook authentication, in my rails app. And, would really appreciate, someone's help, and advice.

 

 I have done the initial requirement. I have got the app_id, and secret id. And, I have attached my omniauth.rb, file, below. If someone can have a look and let me know, what I am doing wrong, that would be highly appreciated. And, the gem, has been bundled. 

 

The error, I am getting is, "The parameter app_id is required".

 
OmniAuth.config.logger = Rails.logger
 
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, ENV['FACEBOOK_590736697630795'], ENV['FACEBOOK_52c90a73196b3f5f4a3761b588211155']
end


#2 Matthew

Matthew

    Passenger

  • Members
  • 2 posts

Posted 18 March 2014 - 07:19 PM

Have you gone to your terminal and checked to make sure those ENV vars are set?

> echo $FACEBOOK_590736697630795

If nothing is printed to the screen, you need to export the values to your environment variables:

export FACEBOOK_KEY="abc123"
export FACEBOOK_SECRET="xyz789"

Then

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']
end





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users