devise: Not found. Authentication passthru.

after following this steps to install devise + facebook oauth from wiki:

https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

I am getting this error

Not found. Authentication passthru.

when I click on:

<%= link_to "Sign in with Facebook", user_omniauth_authorize_path(:facebook) %>

routes.rb

 user_omniauth_authorize GET|POST /users/auth/:provider(.:format)        devise/omniauth_callbacks#passthru {:provider=>/facebook|twitter/}
  user_omniauth_callback GET|POST /users/auth/:action/callback(.:format) devise/omniauth_callbacks#(?-mix:facebook|twitter)

Any advise is welcomed.

Using rails 4, ruby 2.0.0p247 and Ubuntu.

Add: on SO, there are couple of questions for the same problem, but not solved, so I quess that I am not alone who has this problem…

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 15

Most upvoted comments

@jgonzalezd That wasn’t quite my issue as I was working with google_oauth2, where if you alter config.omniauth :google_oauth2, ENV["GOOGLE_ID"], ENV["GOOGLE_SECRET"] at all the server won’t even start. However, My issue seemed to be in a passed parameter to this in

 config.omniauth :google_oauth2, ENV["GOOGLE_ID"], ENV["GOOGLE_SECRET"],
    { :name => "google", # this is the line that was giving me trouble
    :scope => "email",
    :prompt => "select_account",
    :image_aspect_ratio => "square",
    :image_size => 50 }

What I thought was altering the way in which the auth was returned i.e. :google => {:name => "foo", :email => "bar@email.com" } was instead altering and then mismatching the routes. The devise generated user_google_oauth2_omniauth_authentication_path was still pointing to users/auth/google_oauth2/authentication but the marked line in the arguments made the oauth expect users/auth/google/authentication

EDIT* Sorry for all the edits, trying to get the markdown right.