AuthSub目标路径前缀与提供的"下一个"URL不匹配

sha*_*ess 7 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> 
Run Code Online (Sandbox Code Playgroud)

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

他们确实有$next = getCurrentUrl();他们的例子,但是当我尝试时,我得到了未定义的错误.

sha*_*ess 1

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

//$next = "http://$company.mysite.com";
  $next = "http://mysite.com?company=$company";
Run Code Online (Sandbox Code Playgroud)