php - AuthSub 目标路径前缀与提供的 "next"URL 不匹配

标签 php zend-framework google-calendar-api google-authentication zend-gdata

我正在尝试在 PHP 中使用 Gcal API。

我正在使用 ZEND 框架

function getAuthSubUrl($company) 
{
  $next = "http://$company.mysite.com";
  $scope = 'http://www.google.com/calendar/feeds/';
  $secure = false;
  $session = true;
  return (Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session));
}
$authSubUrl = getAuthSubUrl();
echo "<a href=\"$authSubUrl\">login to your Google account"</a> 

我不确定我在这里做错了什么。我几乎完全按照谷歌的例子。

他们的示例中确实有 $next = getCurrentUrl(); 但我在尝试时遇到未定义的错误。

最佳答案

我想通了,我使用的是转发到基于子域的页面的子域。我猜谷歌试图确保你的 $next page 是真实的而我的只是转发。一旦我将 $next 作为主域,它就可以正常工作。然后,我向 url 添加了一些 GET vars 以将其转发回正确的位置。

//$next = "http://$company.mysite.com";
  $next = "http://mysite.com?company=$company";

关于php - AuthSub 目标路径前缀与提供的 "next"URL 不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2445376/

相关文章:

php - 根据 Zend Framework 提供额外的参数来自动完成

php - 谷歌日历 API - PHP

google-app-engine - Google 日历与 Google App Engine 的集成

javascript - 如何刷新客户端 Google api 访问 token ?

php - 尝试在 php pdo 中 catch,以正确的方式执行

php - 如何创建带预览的图像 uploader

PHP:新手问题 - 类似于 php 中的 with/end with ?

php - 使用 Zend Framework 通过 SSL 进行 SOAP 调用

php - 在 jQuery 中克隆或向表单添加输入不会提交到 Firefox 中的 PHP

zend-framework - .htaccess 不工作