Hi Bret,
Could you confirm if your App.config / Web.config have the following keys
in it?
<add key='AuthorizationMethod' value='OAuth2' />
<add key='OAuth2ClientId' value='xxxxxx.apps.googleusercontent.com' />
<add key='OAuth2ClientSecret' value='xxxxxx' />
<add key='OAuth2RefreshToken' value='xxxxxx' />
You could also provide this at runtime by setting the appropriate values to
user.Config object as shown in this wiki article
<https://github.com/googleads/googleads-dotnet-lib/wiki/Understanding-App.config#introduction>,
but this needs to be done before you make a report download call.
Let me know if this doesn't resolve your issue.
Cheers,
Anash P. Oommen,
AdWords API Advisor.
On Friday, September 9, 2016 at 4:17:12 AM UTC-4, Bret Williams wrote:
>
> Hi Josh - I upgraded our AdWords library from v201601 to v201603 and we're
> now getting this error. Did the authentication change in this release?
>
> System.ArgumentNullException: Value cannot be null.
>
> Parameter name: Looks like your application is not configured to use
> OAuth2 properly. Required OAuth2 parameter RefreshToken is missing. You may
> run Common\\Utils\\OAuth2TokenGenerator.cs to generate a default OAuth2
> configuration.
>
> at
> Google.Api.Ads.Common.Lib.OAuth2ProviderBase.ValidateOAuth2Parameter(String
> propertyName, String propertyValue)
>
> at
> Google.Api.Ads.Common.Lib.OAuth2ProviderForApplications.RefreshAccessToken()
>
> at AdWords.Jobs.Google.GoogleReportsJob.GetAPIUser(AdProvider
> credential, String clientCustomerId)
>
> at AdWords.Jobs.Google.GoogleReportsJob.ProcessReport(AdReportJob&
> adReportJob)
>
>
>
> at
> Google.Api.Ads.Common.Lib.OAuth2ProviderBase.ValidateOAuth2Parameter(String
> propertyName, String propertyValue)
>
> at
> Google.Api.Ads.Common.Lib.OAuth2ProviderForApplications.RefreshAccessToken()
>
> at AdWords.Jobs.Google.GoogleReportsJob.GetAPIUser(AdProvider
> credential, String clientCustomerId)
>
> at AdWords.Jobs.Google.GoogleReportsJob.ProcessReport(AdReportJob&
> adReportJob)
>
>
> On Tuesday, April 12, 2016 at 8:39:26 AM UTC-5, Josh Radcliff (AdWords API
> Team) wrote:
>>
>> Hi Pravin,
>>
>> You mentioned "I want to generate refresh token each time", but you only
>> need to generate a *refresh token* *once* for each user whose
>> credentials you want to use. When generating the refresh token, you should
>> set the *access_type* to offline
>> <https://developers.google.com/identity/protocols/OAuth2WebServer#offline>
>> so
>> that you can retrieve new *access tokens* without reprompting the user.
>>
>> If you generate a new *refresh token* every time, you are likely to run
>> into the limit on the # of active refresh tokens -- see section 4 -
>> "Refresh the access token, if necessary"
>> <https://developers.google.com/identity/protocols/OAuth2#basicsteps> of
>> the OAuth guide.
>>
>> Thanks,
>> Josh, AdWords API Team
>>
>> On Tuesday, April 12, 2016 at 6:49:27 AM UTC-4, Pravin Yadav wrote:
>>>
>>> Hi,
>>>>
>>>
>>> Yes i generated it manually using OAuth2 Console's
>>> OAuth2ClientId & OAuth2ClientSecret and then it stored it in database and
>>> used it in my application but it temporary it's not useful in web service
>>> it need to generate automatically after once run Web Service
>>> code because my service execute back-end(background Process run anytime)
>>> and it's offline.
>>>
>>> in my service i want generate refresh token each time when my
>>> service run so token need to generate automatically (offline) and replace
>>> each time it in table's column of my database.
>>>
>>> Some days ago this work properly worked with above(Delegate)
>>> code but now it not generated refresh token (generated only access token) i
>>> need refresh token.
>>>
>>> So please reply the same.
>>>
>>>
>>> Thanks & regards,
>>>
>>> Pravin Yadav
>>>
>>>
>>>
>>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/15fe11aa-18dc-468f-aa3e-e1bbf67f26be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.