Google OAuth 2 Error 400: redirect_uri_mismatch but redirect uri is compliant and already registered in Google Cloud Console

13,140 views
Skip to first unread message

Nicholas Sliter

unread,
Mar 14, 2022, 1:21:38 PM3/14/22
to Google Cloud Developers
Does anyone have a solution to a redurect_uri_mismatch when the redirect uri is already registered in GCP?

I am unable to use Oauth 2 on an internal app hosted on Heroku as I get a 400 error. 

George (Cloud Platform Support)

unread,
Mar 14, 2022, 2:42:18 PM3/14/22
to Google Cloud Developers
Hello, 

How did you register the redirect URI? Setting a redirect URI in Cloud Console is not the proper course of action. You may check this answer to the "Google OAUTH: The redirect URI in the request did not match a registered redirect URI" question in stackoverflow. 

Nicholas Sliter

unread,
Mar 14, 2022, 5:27:50 PM3/14/22
to Google Cloud Developers
It is registered in my app.  Here is an example of a url encoded uri in a network request from my app to google oauth:  redirect_uri=https%3A%2F%2Fmiddcourses2.herokuapp.com%2Fapi%2Fauth%2Fcallback%2Fgoogle

David Charles Martinez

unread,
Mar 15, 2022, 3:29:32 PM3/15/22
to Google Cloud Developers
Hello, I see you have solved this issue by updating your client ID and client secret. Posting this in here so it will be helpful for other users having the same issue.
Reply all
Reply to author
Forward
0 new messages