So I am following this tutorial http://www.indjango.com/access-google-sheets-in-python-using-gspread/ in order to check a information on spreadsheet that is on my drive against an ID tag that is scanned. I am working through this tutorial and I am at the part where I run the get_oauth2_token.py file. The browser pops up and gives me an error code that says

  1. That's an error. Error: rdirect_uri_mismatch

the redirect URI in the request, http://localhost:8080/, does not match the ones authorized for the OAuth client.

However I followed the guide to the T so Idk what to do now. Do I need to specify a different URI since it is a Ras PI? I honestly don't understand what a URI is or what it does. Any help would be fantastic!

closed as off-topic by joan, Jacobm001, goobering, goldilocks Dec 6 '16 at 15:12

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – joan, Jacobm001, goobering, goldilocks
If this question can be reworded to fit the rules in the help center, please edit the question.

  • The 400 error denotes a bad request. I suspect the URI localhost:8080. I would suggest this should a redirect URI to the application. May be in the demo application the mentor might have had an application running at port 8080. Hope it helps. – Varad A G Aug 25 '16 at 15:39
  • Any idea how I could make the URI be pointing at my RAS PI? Like I said I don't know much about this stuff. I have tried looking it up but nothing really puts it in a way that I understand – Wagner2x Aug 25 '16 at 23:19
  • Go to the credentials tab and press the edit button on your creds(the little pencil). Is localhost:8080 a registered redirect URI? Can I get a screenshot of that page? Black out the client id and client secret. – jath03 Sep 28 '16 at 21:17

From your description what I understand is you need to connect to google spread sheet and then you need to lookup some id over there.

If that is the case then on the page "Create Client ID" select the radio button "service account" and that takes you to subsequent screen where you have to provide service name and select the credential file to be saved as json/.p12

Once selected you get a p12 file which you can use in your application. The page then redirects to "Credentials" where you will get your secret token. I have used this oAuth authentication process sometime back for reading the gmail app.

I would recommend you to use the google documentation for more details. Hope you got it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.