4

I've started integrating Omniauth 1.0 into my Rails/Authlogic application and I get a route error when I try to access localhost:3000/auth/facebook.

Are we supposed to create a custom route for each /auth/strategy we want, or is there something else wrong here?

# gemfile
gem 'omniauth-facebook'

# routes
resources :authentications
match '/auth/:provider/callback' => 'authentications#create'

# config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, '20...', 'bc...'
end

# accessing /auth/facebook
No route matches "/oauth/authorize"
sscirrus
  • 55,407
  • 41
  • 135
  • 228

1 Answers1

7

Updated my GemFile with

gem "omniauth-facebook", :git => "git://github.com/mkdynamic/omniauth-facebook.git"

and it worked.

Ben Sharpe
  • 109
  • 1
  • 3
  • Ben - I'm getting `invalid_uri` from Facebook for trying to connect through `localhost`. Do you know what this is about? – sscirrus Nov 04 '11 at 19:50
  • @sscirrus This is probably a Facebook setting. Facebook requires a redirect URI be set (although they now allow multiple). You can modify it by updating your app at https://developers.facebook.com/. – Kevin Sylvestre Nov 07 '11 at 09:04
  • This is a temp fix since the new FB omniauth gem isn't officially released yet. Likely fixed soon as it's an RC. – TLK Nov 08 '11 at 01:35