Google-api-ruby-client: Quickstart token client ID not configured to match client id error

Created on 20 Jan 2017  路  5Comments  路  Source: googleapis/google-api-ruby-client

I am trying to run the ruby quickstart outlined here but when I run ruby quickstart.rb I get the error:

gems/googleauth-0.5.1/lib/googleauth/user_authorizer.rb:135:in `get_credentials': Token client ID of CLIENT_ID does not match configured client id CLIENT_ID (RuntimeError)
    from quickstart.rb:28:in `authorize'
    from quickstart.rb:45:in `<main>'

I have checked and made sure I followed the instructions and that the credentials listed in my developer console match those in the client_secret.json file.

Any thoughts about what the issue or a solution might be?

Most helpful comment

I had this happen to me as well. I think it was because I had a ~/.credentials directory left over from some time when I tried the quickstart in the past (I am guessing with a different account). Deleting the directory fixed the problem for me.

All 5 comments

I had this happen to me as well. I think it was because I had a ~/.credentials directory left over from some time when I tried the quickstart in the past (I am guessing with a different account). Deleting the directory fixed the problem for me.

jcouball is right -- that error means you had a preexisting token in the file pointed to by CREDENTIALS_PATH that was created with a different client ID.

I realize this is > 1 year ago. The answer remains as valid as ever :) When you delete the credentials file, you'll be prompted to validate and you'll be all set 馃槃

Delete token.yaml file

Delete token.yaml file

That's it for me, thanks bongchoung!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eric-hu picture eric-hu  路  4Comments

bootstraponline picture bootstraponline  路  4Comments

arjunmenon picture arjunmenon  路  5Comments

davidraj picture davidraj  路  6Comments

martincalvert picture martincalvert  路  4Comments