Php 400-发生错误。刷新OAuth2令牌时出错,消息:';{“error”:“invalid”u grant}&“x27”;
我升级了有谷歌fusion tables的应用程序,它似乎在我的笔记本电脑上工作,所以一旦我升级了我的网站,我就得到了无效的授权 因此,我为我的网站创建了新的服务帐户和新的服务器应用程序密钥。但我总是犯同样的错误。我读了一些关于删除我的客户机密码的文章,但这只是针对我正在使用服务帐户的web应用程序 我还能做什么 这就是我联系的方式Php 400-发生错误。刷新OAuth2令牌时出错,消息:';{“error”:“invalid”u grant}&“x27”;,php,google-fusion-tables,google-api-php-client,Php,Google Fusion Tables,Google Api Php Client,我升级了有谷歌fusion tables的应用程序,它似乎在我的笔记本电脑上工作,所以一旦我升级了我的网站,我就得到了无效的授权 因此,我为我的网站创建了新的服务帐户和新的服务器应用程序密钥。但我总是犯同样的错误。我读了一些关于删除我的客户机密码的文章,但这只是针对我正在使用服务帐户的web应用程序 我还能做什么 这就是我联系的方式 $client = new Google_Client(); $client->setApplicationName("API Project
$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;
该死的dreamhost,服务器在15分钟后就可以运行了。学习使用ntp人员。我最后检查的是dreamhost上的服务器时间。希望他们能在我开了一张支持票后解决这个问题