How to add or change return uri in google console for oAuth2
Asked Answered
R

4

29

I want to use google oAuth from my webservice i have created new oAuth key but when I use it i get

Error: redirect_uri_mismatch
The redirect URI in the request: www.blabla.com
did not match a registered redirect URI

Now, where to find the registered redirect URI to change it, or where can I add another one. Under "API Access" menu of the console I can only "Edit brand information", "Create Another Client ID" and "Edit allowed domains", but I don't have permissions to add one.

Redwing answered 22/5, 2013 at 13:53 Comment(0)
F
36

It is not immediately apparent as to where to do this in my opinion, so here are some useful screenshots.

1) Navigate to the Credentials screen... something like "https://console.developers.google.com/apis/credentials...."

2) Click on your 'Oauth 2 client I.D.' link.. in this case it is "Web client 1"

2) At the bottom of the screen you can add your site url like - "http://localhost:[some number]/signin-google" and save.

Floozy answered 21/8, 2016 at 14:42 Comment(0)
R
12

My problem was that I have created an Client ID for "Service account". And didn't even tried the wizard for "Web application". Because my controller was making a web request the Web Application option is the right one. Silly me.

Under the Web Application Client ID settings you can adjust the return uri, and Service Account settings don't have that option.

Redwing answered 23/5, 2013 at 6:7 Comment(1)
Right, Service Account client doesn't have a return URI. Great that you figured this out.Dundee
D
2

There's an 'Edit settings' to the right of your client ID. Click it and there will be a popup allowing you to edit authorized redirect URIs.

Dundee answered 22/5, 2013 at 17:37 Comment(1)
On which page is that?Josephus
C
0

Recently I have faced this problem for token generate on Odoo Google shop integration.

In my case when i set redirect URL in Authorized redirect URIs it's still gives me error...
then i add another URI (which is site URL) after this it worked for me!!

step-1 : Navigate to https://console.cloud.google.com/apis/credentials?project=vaulted-anthem-416212

step-2: Select OAuth 2.0 Client IDs...
    Your client Id's name will be : Web Client 1
    If you set another name then you will show this one..

step-3: At bottom in Authorized redirect URIs field:
     a. Paste Your redirect URL
     b. Add another URL which is your site address, it may like : "http://localhost:[some number]/

Capo answered 5/3, 2024 at 6:51 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.