自定义Omniauth Oauth2策略在dev中工作但不是prod

时间:2016-06-04 03:29:03

标签: ruby-on-rails oauth-2.0 timeout omniauth faraday

对于我的生活,我无法弄清楚这里发生了什么。

所以我有一个应用程序,它使用Oauth2作为服务器上的单一标志。我有一个客户端,我添加了一个自定义的omniauth策略,应该在此服务器上进行身份验证。在这两个应用程序的开发过程中,一切都运行良好,但我无法让客户端在生产中与提供程序进行身份验证。但是,我可以让开发中的客户端与生产中的提供程序进行身份验证。所以我认为这可能已经消除了提供商应用程序的问题。

以下是生产中客户端应用程序的堆栈跟踪:

App 20220 stdout: I, [2016-06-03T22:57:14.831517 #20220]  INFO -- omniauth: (softwareportal) Callback phase initiated.
F, [2016-06-03T22:58:14.844030 #20220] FATAL -- :
Faraday::ConnectionFailed (execution expired):
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:880:in `initialize'
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:880:in `open'
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:880:in `block in connect'
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:878:in `connect'
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:852:in `start'
/home/pushprod/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/net/http.rb:1398:in `request'
faraday (0.9.2) lib/faraday/adapter/net_http.rb:82:in `perform_request'
faraday (0.9.2) lib/faraday/adapter/net_http.rb:40:in `block in call'
faraday (0.9.2) lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
faraday (0.9.2) lib/faraday/adapter/net_http.rb:32:in `call'
faraday (0.9.2) lib/faraday/request/url_encoded.rb:15:in `call'
faraday (0.9.2) lib/faraday/rack_builder.rb:139:in `build_response'
faraday (0.9.2) lib/faraday/connection.rb:377:in `run_request'
oauth2 (1.1.0) lib/oauth2/client.rb:93:in `request'
oauth2 (1.1.0) lib/oauth2/client.rb:138:in `get_token'
oauth2 (1.1.0) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
omniauth-oauth2 (1.4.0) lib/omniauth/strategies/oauth2.rb:89:in `build_access_token'
omniauth-oauth2 (1.4.0) lib/omniauth/strategies/oauth2.rb:73:in `callback_phase'
omniauth (1.3.1) lib/omniauth/strategy.rb:227:in `callback_call'
omniauth (1.3.1) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.3.1) lib/omniauth/strategy.rb:164:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.6) lib/rails/engine.rb:518:in `call'
railties (4.2.6) lib/rails/application.rb:165:in `call'
passenger (5.0.28) src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
passenger (5.0.28) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
passenger (5.0.28) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
passenger (5.0.28) src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
passenger (5.0.28) src/ruby_supportlib/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'

所以它开始回调阶段,然后失败了获取令牌我相信。这个电话是超时的,但我无法弄清楚原因。

希望有人之前遇到过这个问题,可以给我一些指示。

0 个答案:

没有答案