【问题标题】:google api can't be contacted from archlinux server无法从archlinux服务器联系google api
【发布时间】:2014-07-11 05:24:30
【问题描述】:

我在 Arch 虚拟服务器上运行 python-social-auth,以在我的应用程序中获取 oauth2 功能。

当我尝试使用谷歌登录时,我被重定向(在我填写表格后):

/complete/google-oauth2/

然后连接超时。

504 Gateway Time-out

我尝试查看服务器是否可以连接到 google 的 api。我认为它不能:

wget https://accounts.google.com/o/oauth2/token

--2014-07-10 15:20:59--  https://accounts.google.com/o/oauth2/token

Resolving accounts.google.com (accounts.google.com)... xxxx:xxxx:xxxx:xxx::xx, xx.xxx.xxx.xx

Connecting to accounts.google.com (accounts.google.com)|xxxx:xxxx:xxxx:xxx::xx|:xxx... failed: Connection timed out.

Connecting to accounts.google.com (accounts.google.com)|xx.xxx.xxx.xx|:xxx... connected.
HTTP request sent, awaiting response... 405 Method Not Allowed
2014-07-10 15:23:06 ERROR 405: Method Not Allowed

我不确定这到底是什么意思。但我猜我的网络不允许我调用那个 url。

我的服务器上的时间首先是默认值,然后我将它切换到你在那里看到的那个,也就是我家的那个。

我只想说,从我家执行相同的 wget 会产生 405 错误,但不会产生超时错误。所以我认为网络有问题。

如果有人可以提供帮助,那就太好了。

提前致谢。

【问题讨论】:

    标签: python networking oauth-2.0 archlinux python-social-auth


    【解决方案1】:

    对https://accounts.google.com/o/oauth2/token 的空 GET 请求不应返回任何有用的信息。您需要将范围、重定向 URL、客户端 ID 等传递给它。

    不过,我无法解释超时。

    【讨论】:

    • 你的意思是wget?对,是真的。我只是这样做看看服务器是否会响应。我看到的是它首先超时。另外,我可以在家中运行完全相同的配置。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-21
    相关资源
    最近更新 更多