HI Christopher,

Could you see if making scope space separated instead of comma separated 
solves your issue?

Cheers,
Anash P. Oommen,
AdWords API Advisor

On Thursday, May 23, 2013 1:50:12 PM UTC+5:30, Christopher Sell wrote:
>
> Hi all, sorry to repost, but I am experiencing a new error using oauth2 
> with google-api-ads-ruby gem and I wanted to update my question.
>
> I am using omniauth for oauth2 authentication with Google.
>   config.omniauth :google_oauth2, ENV['GOOGLE_CONSUMER_KEY'], 
> ENV['GOOGLE_CONSUMER_SECRET'],
>                   {
>                     :scope => 
> "userinfo.email,userinfo.profile,analytics.readonly,
> http://gdata.youtube.com,https://adwords.google.com/api/adwords/";,
>                     :approval_prompt => "force",
>                     :access_type => "offline"
>                   }
>
> *Great: I am able to authenticate the user, get their access_token, 
> refresh_token, and verification_code and store them in my database.*
>
> *Bad: Now I am actually trying to make calls to the AdWords API on their 
> behalf and experiencing the following error:*
> AdsCommon::Errors::AuthError: Authorization error occured: Authorization 
> failed.  Server message:
> {
>   "error" : "invalid_grant"
> }
>
> I know I need to authorize with adwords using the verification code and 
> this is where I am getting the error.
> Here is the method I am using to call the AdWords API. My code is failing 
> on adwords.authorize()
>     config_filename = File.join(Rails.root, 'config', 'adwords_api.yml')
>     adwords = AdwordsApi::Api.new(config_filename)
>     api_version = :v201302
>     token = adwords.authorize({:oauth2_verification_code => 
> google_authentication.verification_code})
>     campaign_srv = adwords.service(:CampaignService, api_version)
>
> Here is my adwords_api.yml file:
> ---
> :authentication:
>   # Authentication method, for web applications OAuth is recommended.
>   :method: OAuth2
>
>   # Auth parameters for OAuth2.0 method.
>   :oauth2_client_id: MY CLIENT_ID
>   :oauth2_client_secret: MY CLIENT SECRET
>   :oauth2_access_type: 'offline'
>   :oauth2_approval_prompt: 'force'
>   # Callback is set up by the application at runtime.
>   :oauth2_callback: '
> http://127.0.0.1:3000/users/auth/google_oauth2/callback'
>
>   # Other parameters.
>   :developer_token: MY_DEVELOPER_TOKEN
>   :user_agent: MARKETSTARTER
> :service:
>   :environment: PRODUCTION
> :connection:
>   # Enable to request all responses to be compressed.
>   :enable_gzip: false
> :library:
>   :log_level: INFO
>
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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