Skip to content
An Vo edited this page Jul 7, 2020 · 2 revisions

Advanced configurations for specific cases.

Slow Oauth providers

When connect to slow oauth providers or slow network, we may encounter Net::ReadTimeout exception. In this case, we could pass additional connection options to OAuth2::Client to extend timeout as below.

client = OAuth2::Client.new(client_id, client_secret,
                            site: '',
                            connection_opts: { request: { timeout: 300 } })

connection_opts[:request][:timeout] open/read timeout in seconds. Ref Faraday custom usage.

Default Faraday adapter use Net::HTTP which has timeout 60 seconds.

Clone this wiki locally