2017-10-06 71 views
0

我試圖在我的python/flask應用程序中實現一個簡單的登錄系統與谷歌身份驗證,但我發現在瀏覽器這個錯誤:python/flask錯誤中的Google身份驗證:redirect_uri的無效參數值:無效的方案:('http:// localhost:8080/oauth2callback',)

  1. That’s an error.

Error: invalid_request

Invalid parameter value for redirect_uri: Invalid scheme: (' http://localhost:8080/oauth2callback ',)

這是瀏覽器的屏幕截圖: enter image description here


谷歌控制檯憑證可以這樣來配置:

Authorised JavaScript origins: http://localhost:8080 
Authorised redirect URIs: http://localhost:8080/oauth2callback 

enter image description here


我的實現是基於這個要點: https://gist.github.com/ashish01/2a4a0f9b525096633ca2

我15行配置,如:

GOOGLE_LOGIN_REDIRECT_URI='http://localhost:8080/oauth2callback', 

,當我嘗試我得到這個錯誤訪問路線'/ home'

有誰知道Google爲什麼會抱怨這個計劃以及如何解決這個問題?

回答

1

你有無效字符在您的重定向URI

(' http://localhost:8080/oauth2callback ',)

額外就結束。

+1

謝謝@DaImTo。 有在配置一個錯字: GOOGLE_LOGIN_CLIENT_ID =「123456789-11111111111111111111.apps.googleusercontent.com」, 你看到逗號到底..我的壞了?! –