Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed token refresh process to use proxy #186

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

n1sym
Copy link
Contributor

@n1sym n1sym commented Feb 3, 2022

background

I used a proxy to authenticate with the Google Ad Manager API.

ad_manager_api.yml

:connection:
  :enable_gzip: false
  :proxy: http://user:password@proxy_hostname:8080

I was able to communicate with the API through the proxy, but after an hour or so, the API stopped responding to me.

/usr/local/bundle/gems/socksify-1.7.1/lib/socksify.rb:178:in `initialize': execution expired (Faraday::ConnectionFailed)
/usr/local/bundle/gems/socksify-1.7.1/lib/socksify.rb:178:in `initialize': execution expired (Net::OpenTimeout)

Due to the fact that the expiration time was one hour (:expires_in: 3599) , I assumed that the refresh process had failed.

I checked the code. I noticed that fetch_access_token!uses a proxy, but refresh! does not.

client.fetch_access_token!(:connection => connection)

I made a patch to use proxy in refresh! as well, and now I can communicate with the API.

If there is another way to solve this problem, I would appreciate it if you could let me know. Thank you.

@donovanfm
Copy link
Contributor

Hi, hukurouo. Thank you for making this change. I need to test this thoroughly before accepting the pull request. I will have an update for you sometime this week.

@donovanfm donovanfm merged commit fe5cf2a into googleads:master Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants