We Are Going To Discuss About Google oAuth 2.0 API Authentication Error: Error 400 – redirect_uri_mismatch (does not comply with policy) DJANGO APP. So lets Start this Python Article.
Google oAuth 2.0 API Authentication Error: Error 400 – redirect_uri_mismatch (does not comply with policy) DJANGO APP
- How to solve Google oAuth 2.0 API Authentication Error: Error 400 – redirect_uri_mismatch (does not comply with policy) DJANGO APP
google's documentation is not clear on this part (probably a bug on google's end too):
go to your GCP console, underOAuth consent screen
, when thePublishing status
isIn production
, we can still puthttp://localhost:8080/oauth-authorized/google
under theAuthorized redirect URIs
without triggering the red error message sayingInvalid Redirect
. However, it doesn't work unless the app is inTesting
status.
so in order to test your app at http://127.0.0.1:8000, you need to bring your GCP app toTesting
status - Google oAuth 2.0 API Authentication Error: Error 400 – redirect_uri_mismatch (does not comply with policy) DJANGO APP
google's documentation is not clear on this part (probably a bug on google's end too):
go to your GCP console, underOAuth consent screen
, when thePublishing status
isIn production
, we can still puthttp://localhost:8080/oauth-authorized/google
under theAuthorized redirect URIs
without triggering the red error message sayingInvalid Redirect
. However, it doesn't work unless the app is inTesting
status.
so in order to test your app at http://127.0.0.1:8000, you need to bring your GCP app toTesting
status
Solution 1
google’s documentation is not clear on this part (probably a bug on google’s end too):
go to your GCP console, under OAuth consent screen
, when the Publishing status
is In production
, we can still put http://localhost:8080/oauth-authorized/google
under the Authorized redirect URIs
without triggering the red error message saying Invalid Redirect
. However, it doesn’t work unless the app is in Testing
status.
so in order to test your app at http://127.0.0.1:8000, you need to bring your GCP app to Testing
status
Original Author Zach Of This Content
Solution 2
hey i was dealing with this problem in ASP.Net MVC,
i think the reason would be the same in php but anyways,
Make sure to copy that url in ur below img to Authorized redirect URIs in OAuth 2.0 Client IDs in Google cloud console.
Original Author Mohamed ElNady Of This Content
Solution 3
Check if you are logged in to your google account.
I was using google chrome browser and turns out I was logged out of Gmail as the session expired and when I logged into Gmail and the issue was resolved
Original Author Prathamesh Vichare Of This Content
Solution 4
In my case, it working in development environment and not in production environment. Enabling API KEY for production resolved the issue.
Original Author Fakhar Abbas Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.