7

I'm using Devise + Rails 3. These are the gems I'm using:

gem 'devise' (1.3.4)
gem 'mm-devise' (1.2)
gem 'omniauth-facebook' (1.3.0)
gem 'omniauth' (1.1.0)
gem 'oauth2' (0.6.1)
gem 'oa-core' (0.3.2)

I followed the setup tutorial on devise/omniauth wiki.

My routes:

devise_for :users
resources :events
resources :posts
resources :users
root :to => "home#index"

devise_scope :user do
  get "sign_in", :to => "devise/sessions#new"
end

devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

Facebook redirects me to:

http://localhost:3000/users/auth/facebook/callback. 

I see the request being stuck in Pending mode on the browser. The server log shows:

(facebook) Callback phase initiated.

but never passes this phase. I set up the callback as suggested in the tutorial:

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController

  def facebook
    ...
  end

  def passthru
    ...
  end
end

What am I missing?

Any help will be appreciated.

Thanks a lot!

Ariel T
  • 2,879
  • 1
  • 21
  • 21

3 Answers3

1

Have you tried checking if there was a failure

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController

  def failure
    debugger
    ...
  end
end
0

This seems to be a problem coming from the JS SDK when using it on port 3000.
Try running your local server on a standard port.

sudo rails s -p 80* or *rvmsudo rails s -p 80
Florent
  • 12,310
  • 10
  • 49
  • 58
0

How are your firewall settings? I had that exact issue when ports 32768 to 61000 were not open. Suffered that for a long time after smart people in Superuser.com told me what is happening. https://superuser.com/questions/479503/why-are-ports-30000-to-60000-needed-when-browsing-the-net

Community
  • 1
  • 1
Mika
  • 1,419
  • 18
  • 37