Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Andrew Dixon's Profile

GitHub User: spinlock99

Comments by Andrew Dixon

Avatar

I'm getting the same error here. I think you need to edit your app on dev.facebook.com and change the website: site_url so that facebook knows where to redirect back to. I haven't figured out what magic needs to be here to get it to work but I'll keep trying.

Got it! Edit your app > website > site url: http://0.0.0.0:3000/

This is working on my ubuntu box. You can figure out what url you need by looking at the url of the page that is giving you the error:

https://graph.facebook.com/oauth/authorize?response_type=code&client_id=141936272547391&redirect_uri=http%3A%2F%2F0.0.0.0%3A3000%2Fauth%2Ffacebook%2Fcallback&parse=query&scope=email%2Coffline_access

you can see that the redirect_uri = http://0.0.0.0:3000/

HTH - Andrew

Avatar

I'm creating an app to allow users to interact with all of their social networks. So, for my use case, I want users to authenticate with facebook, twitter, and linkedin. Anyway, that's why I need user to has_many :authentications.

Avatar

I figured out what the issue was with the "uninitialized constant MultiJson". I just had to add:

> gem "multi_json"

to my Gemfile, bundle install, restart the server and now I'm all good :)

Avatar

Thanks for the fantastic railscast! I've found a minor bug that I was wondering if anyone could explain to me - I'm a rails newb so I have a lot of gaps in my knowledge. When the authentications_controller hits the line:

> render :text => request.env['omniauth.auth'].inspect

The error is:

> NameError in AuthenticationsController#create -
uninitialized constant MultiJson

But, I can print the env information to the logger if I don't try to render the text. Here's a gist of the complete code snippet with the logger lines, which pass, and the render line, which fails:

git://gist.github.com/896700.git

Any idea on what's going on here?

Thanks!