Reputation: 431
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.
Upvotes: 31
Views: 63604
Reputation: 9
i was developing on http://127.0.0.1:3000 , my mistake was i did set my uri in google cloud console redirect uri to be http://127.0.0.1:3000 when i used http://127.0.0.1:3000/api/auth/callback/google it worked!
Upvotes: 0
Reputation: 451
Just notice that the Redirect URI field is only displayed for Web Application.
This means that you have to chose the Web App type (and not Desktop App) when you create the OAuth Client ID for this field to be displayed.
Upvotes: 0
Reputation: 1
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]/
Upvotes: 0
Reputation: 722
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.
Upvotes: 37
Reputation: 431
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.
Upvotes: 12
Reputation: 334
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.
Upvotes: 2