Faraday timeout error with omniauth (custom strategy)/doorkeeper

五迷三道 提交于 2019-11-30 14:17:58

I'm not sure this applies to you been here was my scenario:

Problem

  • An app with data that our internal OAuth server wants
  • An OAuth server with little, to no data on it
  • We want to offload the authentication portion of App1 to App2 without moving data

Solution

  • App1 uses App2 as the Authentication server
  • App2 uses App1 for user data

Problem from this solution

Deadlock - App1 is waiting for an OAuth response from App2, but to complete that response App2 must wait for a response from App1.

Final observation

In development mode on Rails (with WebBrick) you can't run multi-threaded, so the request may never be allowed to complete.

My solution

My solution was to install puma and add to config/environments/development.rb:

if ENV["THREADS"]
  config.threadsafe!
end

Then when you start the server you'd do THREADS=1 rails s Puma to test your OAuth stuff.

OR

Or your scenario is completely different and you're actually not communicating between your services. Is your extra_info (like Github's /user) endpoint functioning on the OAuth server? Is your callback actually doing anything?

I hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!