2012-12-15 64 views
1

我想验证域名是否为google文档范围。这是网址:Google Apps Auth with edu.au域名

https://www.google.com/accounts/AuthSubRequest?next=http%3A%2F%2Fwww.mydomain.edu.au%2Fcomponents%2Fgoogle%2FretrieveToken.php&scope=https%3A%2F%2Fdocs.google.com%2Ffeeds%2F&session=1&secure=0&hd=default

所以我的域名是:www.mydomain.edu.au

但随后makng请求时,我得到这样的回答:

The page you have requested cannot be displayed. Another site was requesting access to your Google Account, but sent a malformed request. Please contact the site that you were trying to use when you received this message to inform them of the error. A detailed error message follows: 
The site "http://edu.au" has not been registered. 

所以其确定为edu.au域名。

有没有办法解决这个问题?

感谢名单

样本上传文件到Google文档代码:

public static function uploadDocs($data = array()) 
{ 
    if (!self::checkInput($data)) return false; 
    $data['url'] = Google::docsAPIUrl.'default/private/full'.self::getFolder($data['folderId']); 
    //"?convert=false" 
    $headers = Google::getAuthToken(); 
    array_push($headers, Google::getGData()); 
    $contentHeaders = self::getInputHeaders($data); 
    array_push($headers, 'Content-Length: '.$contentHeaders['length']); 
    array_push($headers, 'Content-Type: '.$contentHeaders['type']); 
    array_push($headers, 'Slug: '.Html::win2utf8($data['docTitle'])); 
    if ($data['inputMethod'] == 'File') 
    { 
     $data['input'] = ((fread(fopen($data['input'], 'rb'), filesize($data['input'])))); 
    } 
    $curl = Google::curl($data['url'], null, $data['input'], $headers); 
    if (Curl::checkCode($curl['code'])) 
    { 
     return self::parseNewXML($curl['response']); 
    } 
    else 
    { 
     Google::$error = array('errorCode'=>$curl['code'],'errorString'=>$curl['response']); 
     return false; 
    } 
} 
+0

你能提供更多关于你实际上想要在这里做什么的细节吗?最终目标是... –

+0

我的最终目标是通过谷歌文档生成PDF并下载到服务器。 – BlueZero

回答

0

的AuthSub已弃用。您应该使用OAuth 2.0Drive API v2

+0

我不想花时间开发新功能,如果我不必。 AuthSub仍然有效。 – BlueZero

+0

你使用的是什么API(和API的版本)?你的代码是否曾经工作过,现在已停止工作或者正在开发新的东西?你的代码是什么样的? –

+0

我做了一个处理谷歌应用程序请求的组件。它适用于每个范围都不同的AuthSubSessionToken。对于我的新应用/网络,我只需要google文档的令牌。代码是OOP。似乎我不能粘贴在这里...所以我已经添加了一个原始Q的功能。 – BlueZero

相关问题