-
-
Notifications
You must be signed in to change notification settings - Fork 621
Advanced usage
An Vo edited this page Jul 7, 2020
·
2 revisions
Advanced configurations for specific cases.
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.