Faraday timeout error with omniauth (custom strategy)/doorkeeper

前端 未结 1 1761
温柔的废话
温柔的废话 2021-01-02 22:57

I\'m currently following along with this railscast and for my specific situation am running into a Faraday timeout error on the callback from omniauth.

Currently I\'m

相关标签:
1条回答
  • 2021-01-02 23:32

    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!

    0 讨论(0)
提交回复
热议问题