Google OAuth 2 authorization - Error redirect uri mismatch

0 votes


On the website https://code.google.com/apis/console I have registered my application, set up a generated Client ID: and Client Secret to my app and tried to log in with Google. Unfortunately, I got the error message:

Error: redirect_uri_mismatch 
The redirect URI in the request: http://127.0.0.1:3000/auth/google_oauth2/callback did not match a registered redirect URI 

scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email 
response_type=code 
redirect_uri=http://127.0.0.1:3000/auth/google_oauth2/callback 
access_type=offline 
approval_prompt=force 
client_id=generated_id

What does this message mean, and how can I fix it? I use the gem omniauth-google-oauth2.

Feb 16, 2022 in Others by Aditya
• 7,680 points
6,118 views

1 answer to this question.

0 votes
To answer your question, you need to redirect URI where the response is returned and has to be registered in the APIs console, and the error is indicating that you haven't done that, or haven't done it correctly. Go to the console for your project and look under API Access. You should see your client ID & client secret there, along with a list of redirect URIs. If the URI you want isn't listed, click edit settings and add the URI to the list.

Please Note that updating the google api console and that change being present can take some time. Generally only a few minutes but sometimes it seems longer.
answered Feb 16, 2022 by Soham
• 9,710 points

Related Questions In Others

0 votes
0 answers
0 votes
1 answer

It shows black screen when trying to load Map on device with ionic 2 Google Map Native plugin

In order to answer your question, start ...READ MORE

answered Feb 8, 2022 in Others by Rahul
• 9,680 points
1,754 views
0 votes
1 answer

What is the difference between hadoop and google analytics ?

I will try and answer this as ...READ MORE

answered Aug 22, 2018 in Others by Frankie
• 9,830 points
1,591 views
0 votes
1 answer

Using unserialize in PHP throws the same error repeatedly

I googled 'Node no longer exists', and ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,250 points
1,594 views
0 votes
1 answer

Django AllAuth gives SSLError

It can be fixed by replacing: client = ...READ MORE

answered Mar 20, 2019 in Python by SDeb
• 13,300 points
1,113 views
0 votes
0 answers

Azure DevOps REST API Authentication with PKCE

Does Azure DevOps REST API support OAuth ...READ MORE

Apr 17, 2022 in Other DevOps Questions by Kichu
• 19,040 points
595 views
0 votes
0 answers

Sync contacts using Google Contacts API version 3.0 and NodeJS' Passport

I'm using passport and would like to ...READ MORE

Jun 21, 2022 in Node-js by Vaani
• 7,070 points
531 views
0 votes
0 answers

Sync contacts using Google Contacts API version 3.0 and NodeJS' Passport

I want to sync Google contacts with ...READ MORE

Jun 22, 2022 in Node-js by Vaani
• 7,070 points
674 views
0 votes
2 answers

emulator: emulator: error: x86 emulation currently requires hardware acceleration!

To answer your question, there are a ...READ MORE

answered Feb 9, 2022 in Others by Soham
• 9,710 points
1,318 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP