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

Handle errors when fetching access token at callback phase #16

Closed
ivan05almeida opened this issue Apr 10, 2019 · 0 comments
Closed

Handle errors when fetching access token at callback phase #16

ivan05almeida opened this issue Apr 10, 2019 · 0 comments

Comments

@ivan05almeida
Copy link
Contributor

At the callback_phase if an error occurs on the fetch of the access_token the strategy is not handling the error.

Error Trace:

Rack::OAuth2::Client::Error (invalid_client :: invalid client credentials):
  rack-oauth2 (1.9.3) lib/rack/oauth2/client.rb:171:in `handle_error_response'
  rack-oauth2 (1.9.3) lib/rack/oauth2/client.rb:148:in `handle_response'
  rack-oauth2 (1.9.3) lib/rack/oauth2/client.rb:122:in `access_token!'
  /Users/coffeebean/Bitbucket/omniauth_openid_connect/lib/omniauth/strategies/openid_connect.rb:189:in `access_token'
  /Users/coffeebean/Bitbucket/omniauth_openid_connect/lib/omniauth/strategies/openid_connect.rb:114:in `callback_phase'
  omniauth (1.9.0) lib/omniauth/strategy.rb:238:in `callback_call'
  omniauth (1.9.0) lib/omniauth/strategy.rb:189:in `call!'
  omniauth (1.9.0) lib/omniauth/strategy.rb:169:in `call'
  exception_notification (4.3.0) lib/exception_notification/rack.rb:41: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.11) lib/rack/etag.rb:24:in `call'
  rack (1.6.11) lib/rack/conditionalget.rb:25:in `call'
  rack (1.6.11) lib/rack/head.rb:13:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/flash.rb:260:in `call'
  rack (1.6.11) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.11) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  activerecord (4.2.11.1) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.2.11.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  activerecord (4.2.11.1) lib/active_record/migration.rb:377:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.11.1) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
  activesupport (4.2.11.1) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
  activesupport (4.2.11.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.11.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.11.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.11.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.11.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.11.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.11.1) lib/rails/rack/logger.rb:20:in `call'
  request_store (1.4.1) lib/request_store/middleware.rb:19:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.11) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.11) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.11.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.11) lib/rack/lock.rb:17:in `call'
  actionpack (4.2.11.1) lib/action_dispatch/middleware/static.rb:120:in `call'
  rack (1.6.11) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.11.1) lib/rails/engine.rb:518:in `call'
  railties (4.2.11.1) lib/rails/application.rb:165:in `call'
  rack (1.6.11) lib/rack/content_length.rb:15:in `call'
  puma (3.12.0) lib/puma/configuration.rb:225:in `call'
  puma (3.12.0) lib/puma/server.rb:658:in `handle_request'
  puma (3.12.0) lib/puma/server.rb:472:in `process_client'
  puma (3.12.0) lib/puma/server.rb:332:in `block in run'
  puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread'
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