簡體   English   中英

Python社交身份驗證錯誤

[英]Python Social Auth Error

我正在使用 Python Social Auth 包來使用 Google OAuth 服務。 它在我的本地機器上運行良好。 但是,當我在 VM linux 機器上部署該應用程序時,出現以下錯誤:

AuthFailed at /complete/google-oauth2/

Authentication failed: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)

Exception Type:     AuthFailed
Exception Value:    Authentication failed: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)

有人可以幫幫我嗎? 提前致謝。

我最近使用相同的包進行測試,並遇到了同樣的問題。

如果您使用http://127.0.0.1:8000訪問您的服務器,則將其替換為http://localhost:8000/后跟您的 URL 路徑

Google 需要 HTTPS 請求,因此使用localhost將代表開發服務器

這已經為我解決了這個問題。 我從這里遇到了這個解決方案https://youtu.be/wlcCvzOLL8w

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM