realpython / realpython/materials
redirect_uri_mismatch http://127.0.0.1:5000/login/callback
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 5.2k
- Forks
- 5.3k
- Ø Merge
- 4 T. 10 Std.
- Gemergte PRs (30 T.)
- 10
Beschreibung
I've really enjoyed the content. Found the blog re "Create a Flask Application With Google Login"
https://realpython.com/flask-google-login/
https://github.com/realpython/materials/blob/master/flask-google-login/
I got to running the app and this error.
Error: redirect_uri_mismatch
The redirect URI in the request, http://127.0.0.1:5000/login/callback, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/310636517232-hh287vg31jbjbqe0hguc2ahmtqcrbr13.apps.googleusercontent.com?project=310636517232
I have setup nginx to redirect a domain to my flask server. Loads on a https page with a valid cert generated by certbot.
have configured my google app with my domain url.
have a working route at mydomain/login/callback
I can't see where http://127.0.0.1:5000 is set in my code. I did find old stackexchange references to setting the redirect instead of accepting the default (java examples not python).
The as published demo with redirection to localhost was working for me previously. (have deleted the previously working with localhost google app and created new google app, updated environment variables etc. exited shell, restarted ubuntu etc.
ideas?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit dem Material zu flask-google-login und prüfen Sie, wie die OAuth-Callback-URL aus der Anwendungskonfiguration und den Umgebungsvariablen zusammengesetzt wird. Vergleichen Sie diesen Wert mit der für den Google-OAuth-Client registrierten Domain und Callback-URI; das Problem ist behoben, wenn der bereitgestellte HTTPS-Callback ohne redirect_uri_mismatch akzeptiert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- flask, python
- Bereich
- authentication, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100