I have a small Django website, and I've connected OAuth 2.0. It worked just fine on localhost.
(In the Google Console, the authorized redirect URIs were: URI 1: http://127.0.0.1:8000/ URI 2: http://127.0.0.1:8000/google/login/callback/)
Now I have moved the website to hosting and changed the URLs to:
URI 1: https://yukkiewqr.eu.pythonanywhere.com/ URI 2: https://yukkiewqr.eu.pythonanywhere.com/google/login/callback/
However, when I'm trying to log in through Google, I see the following error:
"Access blocked: This app’s request is invalid. You can’t sign in because this app sent an invalid request. You can try again later or contact the developer about this issue. Learn more about this error. If you are a developer of this app, see error details. Error 400: redirect_uri_mismatch."
On my website, I am using the Django Framework and the AllAuth plugin to connect to Google.
I would be very grateful if anyone knows how to fix it
The error "redirect_uri_mismatch" (Error 400) occurs when the redirect URI sent in the authentication request does not match the authorized redirect URIs in your Google Cloud Console. Since you already changed the uri in Google Cloud Console, make sure it matches the one in the your code as well (either in your Django Settings or where you construct the google oauth client).