Hi, So, we're having some issues with authentication in Ruby.
In our application, the user logs in and grants offline access. This seems to be working ok, we're getting both the access and refresh token and we're stashing them in the database as a hash that reads {access_token => 'XYZ', refresh_token => 'ABC'} We then have a backend process that is supposed to go through each job for that day and make the alterations the user wants using their stored credentials. This is where that task is falling down. Code at present is; require 'adwords_api' class Job def initialize(job) def initialize(job) @id = job.id @uniqueid = job.uniqueid @campaignid = job.campaignid @adgroupid = job.adgroupid @authtoken = eval(job.token) end def get_report(report_type) adwords = AdwordsApi::Api.new jobtoken = @authtoken token = adwords.authorize({ :oauth2_token => jobtoken }) api_version = :v201603 report_def_srv = adwords.service(:ReportDefinitionService, api_version) fields = report_def_srv.get_report_fields(report) end (yeah, I know the eval on the jobtoken isn't secure) This works fine, and when I call get_report I get the data back.....so long as it's reasonably soon after the user granted authentication and the access token is still valid. Once that's no longer true, I get AdwordsApi::V201603::ReportDefinitionService::ApiException: [AuthenticationError.OAUTH_TOKEN_INVALID @ ; trigger:'<null>'] I know there's supposed to be some sort of handshake where I give Google the refresh token and in exchange get the new access token, but the docs seem to suggest the Adwords Gem should handle that itself? If anyone's got any ideas they'd be much appreciated. -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 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. 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/e4ed307d-8340-41ff-bb06-ba440c8b7e30%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.