Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a valid mapping for path "/auth/oauth2/callback" #56

Closed
hopewise opened this issue Mar 30, 2018 · 1 comment
Closed

Could not find a valid mapping for path "/auth/oauth2/callback" #56

hopewise opened this issue Mar 30, 2018 · 1 comment
Milestone

Comments

@hopewise
Copy link

My rails app integrated with Auth0 with no issue, however, when I upgraded omniauth-auth0 from 1.4.2 to ~> 2.0.0 it forced me to upgrade omniauth-oauth2 from 1.3.1 to ~> 1.4

then, after upgrading, I started getting this error after social login with Lock 11:

Could not find a valid mapping for path "/auth/oauth2/callback"

My code base has not been touched, I only upgraded the gems.

Full trace:

devise (4.3.0) lib/devise/mapping.rb:49:in `find_by_path!'
devise (4.3.0) lib/devise/omniauth.rb:17:in `block in <top (required)>'
omniauth (1.6.1) lib/omniauth/strategy.rb:478:in `call'
omniauth (1.6.1) lib/omniauth/strategy.rb:478:in `fail!'
omniauth-oauth2 (1.4.0) lib/omniauth/strategies/oauth2.rb:71:in `callback_phase'
omniauth (1.6.1) lib/omniauth/strategy.rb:230:in `callback_call'
omniauth (1.6.1) lib/omniauth/strategy.rb:187:in `call!'
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call'
omniauth (1.6.1) lib/omniauth/builder.rb:63:in `call'
rack (1.6.9) lib/rack/deflater.rb:35:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (1.6.9) lib/rack/etag.rb:24:in `call'
rack (1.6.9) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.9) lib/rack/head.rb:13:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.9) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.9) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.8) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.8) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.8) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.8) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.8) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.8) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.8) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.8) lib/rails/rack/logger.rb:20:in `call'
request_store (1.3.2) lib/request_store/middleware.rb:9:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.9) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.9) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.8) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.9) lib/rack/lock.rb:17:in `call'
dragonfly (1.1.3) lib/dragonfly/cookie_monster.rb:9:in `call'
actionpack (4.2.8) lib/action_dispatch/middleware/static.rb:120:in `call'
font_assets (0.1.14) lib/font_assets/middleware.rb:17:in `block in call'
font_assets (0.1.14) lib/font_assets/middleware.rb:40:in `do_request'
font_assets (0.1.14) lib/font_assets/middleware.rb:16:in `call'
rack (1.6.9) lib/rack/sendfile.rb:113:in `call'
lib/rack/seoredirect.rb:20:in `call'
sentry-raven (2.7.1) lib/raven/integrations/rack.rb:51:in `call'
railties (4.2.8) lib/rails/engine.rb:518:in `call'
railties (4.2.8) lib/rails/application.rb:165:in `call'
railties (4.2.8) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.8) lib/rails/railtie.rb:194:in `method_missing'
rack (1.6.9) lib/rack/deflater.rb:35:in `call'
rack (1.6.9) lib/rack/lock.rb:17:in `call'
rack (1.6.9) lib/rack/content_length.rb:15:in `call'
rack (1.6.9) lib/rack/handler/webrick.rb:88:in `service'
/Users/Apple/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/Users/Apple/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/Users/Apple/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
@joshcanhelp
Copy link
Contributor

Callback path should be /auth/auth0/callback. Here's what I have:

# config/routes.rb

# ...
namespace 'auth' do
  scope ':provider' do
    get 'callback'
    get 'failure'
  end
end
# ...

If you're using Lock, make sure you're setting a state explicitly, as explained here.

Please re-open if you're still having this issue 👍

@joshcanhelp joshcanhelp added this to the v2-Next milestone Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants