0

我升级了我的应用程序,它有一个谷歌融合表,它似乎可以在我的笔记本电脑上运行,所以一旦我完成了,我升级了我的网站,我得到了无效的授权

因此,我为我的网站创建了新的服务帐户和新的服务器应用程序密钥。但我不断收到同样的错误。我读过一些关于删除我的客户端密码的内容,但这仅适用于我使用服务帐户的 Web 应用程序。

我还可以做些什么。

这就是我连接的方式。

$client = new Google_Client();
        $client->setApplicationName("API Project");
        $client->setClientId(CLIENT_ID);

        // Set your cached access token. Remember to replace $_SESSION with a
        // real database or memcached.
        if (isset($_SESSION['token'])) {
            $client->setAccessToken($_SESSION['token']);
        }

        $key = file_get_contents(KEY_FILE);

        $client->setAssertionCredentials(new Google_AssertionCredentials(
                SERVICE_ACCOUNT_NAME,
                array('https://www.googleapis.com/auth/fusiontables'),
                $key)
        );

        //$client->authenticate();

        if ($client->getAuth()->isAccessTokenExpired()) {
            $client->getAuth()->refreshTokenWithAssertion();
        }

        if ($client->getAccessToken()) {
            $_SESSION['token'] = $client->getAccessToken();
        }


        $token = $_SESSION['token'];

        var_dump($token);

        return $token;
4

1 回答 1

0

该死的你dreamhost,服务器是15分钟后的未来。学习使用ntp的人。我检查的最后一件事是dreamhost 上的服务器时间。希望他们能在我打开支持票后解决这个问题。

于 2013-10-30T00:22:53.243 回答