One quick last question.

When I'm reusing a token generated by  api.authorize(
{
  :oauth2_callback => login_callback_url,
  :oauth2_verification_code => params[:code]
} it seems as if the token does not expire. I have waited 6 hours and I can 
still reuse the same token for API calls. Is it possible that the 
Oauth2-Api itself requests a new token and uses this instead of the 
provided one, if the token is expired? Best regards Johannes
Am Freitag, 22. März 2013 14:26:05 UTC+1 schrieb johanne...@chads.io:
>
> Thank you Danial.
>
> Your help is always very much appreciated. Keep it!
>
> Best regards
>   Hannes
>
> On Thursday, March 21, 2013 8:24:16 AM UTC+1, Danial Klimkin wrote:
>>
>> Hello Hannes,
>>
>>
>> There is no such guide, but the difference for the library users should 
>> be minimal.
>>
>> authorize() will return you a hash which needs to be stored. The 
>> permanent token is called "refresh_token", it is used to obtain a fresh 
>> access_token when required.
>>
>> Please see the AdWords on Rails example for more details:
>>
>>   https://code.google.com/p/google-api-ads-ruby/wiki/AdWordsRailsDemo
>>
>>
>> -Danial, AdWords API Team.
>>
>>
>> On Monday, March 18, 2013 6:59:48 PM UTC+4, johanne...@chads.io wrote:
>>>
>>> Hello Danial,
>>>
>>> is there a guide to convert from OAuth 1.0a to OAuth2? Specifically, is 
>>> it still possible to use 'api.authorize' to receive a session token that 
>>> is indefinitely valid?
>>>
>>> Best regards
>>>   Hannes
>>>
>>> On Wednesday, August 8, 2012 5:20:10 PM UTC+2, Danial Klimkin wrote:
>>>>
>>>> Hello yoshi,
>>>>
>>>>
>>>> The library provides it as the exception field, see:
>>>>
>>>>   
>>>> http://code.google.com/p/google-api-ads-ruby/source/browse/ads_common/lib/ads_common/errors.rb#44
>>>>
>>>> I recommend to use the OAuth2 instead though. OAuth1.0a is deprecated 
>>>> and should not be used for the new projects.
>>>>
>>>>
>>>> -Danial, AdWords API Team.
>>>>
>>>>
>>>> On Tuesday, August 7, 2012 1:15:51 PM UTC+4, yoshi wrote:
>>>>>
>>>>> Where do you get the request_token object from?
>>>>>
>>>>> On Wednesday, May 30, 2012 4:51:34 PM UTC+2, Danial Klimkin wrote:
>>>>>>
>>>>>> Hello Thomas,
>>>>>>
>>>>>>
>>>>>> You can request an authorization and get token this way (in the 
>>>>>> callback):
>>>>>>
>>>>>> token = api.authorize({:oauth_request_token => 
>>>>>> request_token, :oauth_verification_code => params[:oauth_verifier]})
>>>>>> session[:token] = session[:token]
>>>>>>
>>>>>> Here is how I re-create the API object from the session:
>>>>>>
>>>>>> api = AdwordsApi::Api.new(config_filename)
>>>>>> token = session[:token]
>>>>>> # If we have an OAuth token in session we use the credentials from it.
>>>>>> if token
>>>>>>   credentials = api.credential_handler()
>>>>>>   credentials.set_credential(:oauth_token, token.token)
>>>>>>   credentials.set_credential(:oauth_token_secret, token.secret)
>>>>>>   # You may want to restore the CID as well
>>>>>>   credentials.set_credential(:client_customer_id, selected_account)
>>>>>> end
>>>>>>
>>>>>> Depending on how you store the session you may want to store just 
>>>>>> 2 strings instead of the full token object.
>>>>>>
>>>>>>
>>>>>> -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

--- 
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 adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to