我使用Google Mirror API發佈了一個應用程序。現在我正試圖在一個新的web地址.info中建立一個測試版應用程序,而不是.com。然而,當我從.info地址授權我的應用時,我被重定向到.com。我有三重檢查了我的代碼和我的客戶ID和祕密的地址。什麼會造成這種情況?我將附上我的API設置的屏幕截圖,儘管它看起來像是關於外星人或其他事物的絕密政府文件。Google API重定向將我的應用程序發送到錯誤的頁面
這是客戶端從調用。
$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是正確的。
你可以三重檢查$ base_url是否確實以「.info」而不是「.com」結尾,並且您將代碼推送到正確的實例? – Alain 2013-05-07 16:12:44