-1

我使用 Google Mirror API 发布了一个应用程序。现在我正在尝试在新的网址 .info 而不是 .com 上设置一个测试版应用程序。但是,当我从 .info 地址授权我的应用程序时,我会被重定向到 .com。我已经三次检查了我的代码中的地址以及我的客户 ID 和机密。什么可能导致这种情况?我将附上我的 API 设置的屏幕截图,尽管它看起来像是关于外星人或其他东西的绝密政府文件。

https://code.google.com/apis/console

这是调用客户端的地方。

 $client = new Google_Client();

  $client->setApplicationName($app_name);

  // These are set in config.php
  $client->setClientId($api_client_id);
  $client->setClientSecret($api_client_secret);
  $client->setDeveloperKey($api_simple_key);
  $client->setRedirectUri($base_url."/oauth2callback.php");

  $client->setScopes(array(
    'https://www.googleapis.com/auth/glass.timeline',
    'https://www.googleapis.com/auth/glass.location',
    'https://www.googleapis.com/auth/userinfo.profile'));

我知道 $base_url、$api_client_key 和 $api_client_secret 是正确的。

4

2 回答 2

1

好吧,我想有人无法回答这个问题,因为它与代码或 Google API 无关。设置我们的网络服务器的人已经设置 Apache 将 https 流量重写到 .com 地址。很难发现,因为两个目录中都有重复的文件。

于 2013-05-07T19:24:05.687 回答
0

由于您同时注册了 .com 和 .info 重定向,您可能需要确保 $api_client_id 与您用于 .info 的那个匹配,而不是与您用于 .com 的那个匹配。

作为最后的手段 - 尝试删除 .com ClientID 的条目。

于 2013-05-07T16:39:25.437 回答