googleads / google-api-ads-ruby

Ad Manager SOAP API Client Libraries for Ruby
297 stars 227 forks source link

Invalid Grant Authorization error: Issue with migration from v201405 to v201505 #66

Closed manjunath-nm89 closed 9 years ago

manjunath-nm89 commented 9 years ago

I upgraded to google-dfp-api v0.10.1 as the DFP API version v201405 will no longer be supported.

I use OAuth2 Service Account authentication scheme. After the upgrade, the only change which I did was change the constant OAuth2_JWT to OAUTH2_SERVICE_ACCOUNT in the dfp_api.yml file.

I deployed to my staging environment, and I ran the following.

dfp_api = DfpApi::Api.new
network_service = dfp_api.service(:NetworkService, :v201505)
networks = network_service.get_all_networks

I got this

{
  "error": "invalid_grant"
}

I ensured in my admin console that my service account is authorized to pull data from DFP. Previously the above lines of code used to work fine on v201405. Am I missing something here ?

banderson623 commented 9 years ago

We've seen the same thing when upgrading to 10.0

manjunath-nm89 commented 9 years ago

@banderson623 what did you guys do ? Did you guys move to a older version of the dfp-api and use older version of the DFP API ?

nicholaschen commented 9 years ago

Hey all,

Was ads-common also updated? Not that I think this is the root cause since it gets past that point (and since gem install should update both), but there was very much a misspelling in ads_common that likely would've broken this as well.

Just want to do a sanity check on what version that's using.

banderson623 commented 9 years ago

@manjunath-nm89 We didn't upgrade ours either, we just stayed with and older version.

@nicholaschen Yes ads-common was also updated, but let me take a look again with this fix misspelling.

manjunath-nm89 commented 9 years ago

@nicholaschen I'm very sure it is not the issue with the misspelling as we are using the fixed version of google-ads-common.

@banderson623 you need to upgrade soon as the dfp api will no longer support v201405 as of Aug 31st, 2015. Can you please tell me what dfp-api gem version you are using and the API version you are currently on.

manjunath-nm89 commented 9 years ago

I tried older versions of google-dfp-api as well like 0.9.3 which supports DFP API v201411 and ran into the same issue.

We are using service_account to impersonate and we heavily rely on it.

Can you please help me to resolve this issue before Aug 31st.

nicholaschen commented 9 years ago

Interesting, so an older version of the gem - with no code changes - just stops working? Even now if you're using v201405?

(mind starting a thread on our api forum here: https://groups.google.com/forum/#!forum/google-doubleclick-for-publishers-api so I can track this?)

nicholaschen commented 9 years ago

As another point, we changed the scope for the DFP API back in v201408 to https://www.googleapis.com/auth/dfp

you might want to check that you've updated this.

manjunath-nm89 commented 9 years ago

Awesome. I missed that. That worked. Thanks !