AuthSub target path prefix does not match the provided “next” URL

*爱你&永不变心* 提交于 2019-12-08 19:15:43

问题


I am trying to use the Gcal API in PHP.

I am using the ZEND framework

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> 

I am not sure what I am doing wrong here. I am following the google example almost exactly.

They do have $next = getCurrentUrl(); in their expample but I am getting undefined errors when I try that.


回答1:


I figured it out, I was using a subdomain that was forwarding to pages based on the subdomain. I guess Google tries to make sure that your $next page is real and mine were just forwards. Once I made $next the main domain it worked fine. I then just added some GET vars to the url to forward it back to the right place.

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


来源:https://stackoverflow.com/questions/2445376/authsub-target-path-prefix-does-not-match-the-provided-next-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!