Hello Danial,

thx for the fast reply.

I got the example working (which I should have done from the beginning).

The problem is, that my programming-workflow is different from the example.

Example (stateful): 
1) make request (with adwords-obj, and generate consumer)
2) get token
3) make new request (reuse adwords-obj with consumer)

My App (stateless):
1) make request (new adwords-obj)
2) redirect user to Auth-Page
3) create new adwords-obj (new consumer) based on data from a db
4) make request with verification token set

Now, the problem seems to me, that I don't know which tokens I need to save 
and where to get them from. I don't want the User to authenticate each 
request. This problem is addressed in the other libraries 
(UpgradeOAuthToken), but as far as I can see, not in the ruby library.

Also, I've noticed (which is the most likely culprit), that the 
cosumer-object is created during/after a request is made. That seems to be 
the underlying assumption in the ruby-example. But I'm not sure.

best regards
  Thomas

Am Mittwoch, 30. Mai 2012 12:45:26 UTC+2 schrieb Danial Klimkin:
>
> Hello Thomas,
>
>
> I am the library author and will be happy to help you to get it working.
>
> As for the example, it does not provide redirect URL as it doesn't make 
> sense for a console application. Does the example code work if you make no 
> changes and run it as-is, passing verification code?
>
> We plan to release a Rails example to better demonstrate the OAuth method 
> with redirect URL soon.
>
>
> -Danial, AdWords API Team.
>
>
>
> On Wednesday, May 30, 2012 1:41:43 PM UTC+4, Thomas wrote:
>>
>> Hello,
>>
>> I'm trying to work out how to use OAuth with the Google Adwords API. 
>> Sofar I didn't have much luck. While using ClientLogin is working perfect, 
>> OAuth will always throw "AuthenticationError.OAUTH_TOKEN_INVALID".
>>
>> I tried my best to stay as close to the Ruby-Example in v201109_01 as 
>> possible, but still no luck.
>>
>> What works:
>>
>> 1) Making a request against the API with OAuth returns 
>> an AdsCommon::Errors::OAuthVerificationRequired Error.
>> 2) Using the provided URL to redirect the user to the authentication page 
>> (why not provide the redirection URL in the ruby example?)
>>
>> Now it stops working: I set the verification code like so (like in the 
>> example): credential_handler.set_credential(:oauth_verification_code, 
>> options[:oauth_verification_code]).
>> Now doing a new request results 
>> in AuthenticationError.OAUTH_TOKEN_INVALID.
>>
>> I honestly couldn't get it to work. My questions:
>>
>> 1) Could it have something todo with the account I'm using to allow 
>> access to Adwords? I'm using an MCC-Account with administration rights.
>> 2) Why is the ruby implementation so different from phyton or php? 
>> (UpgradeAuthToken?)
>>
>> I'm really at a loss here.
>>
>> Best regards
>>   Thomas
>>
>>

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to