谷歌Buzz API错误
-
18-09-2020 - |
题
我正在尝试使用Google Buzz API将一些内容发布到我的Google Buzz帐户。 我尝试使用他们提供的示例代码,但它给出了以下错误
Array
.
( [http_code]=> 401 [标题]=>数组 ( [www-authenticate]=> authsub realm=“https://www.google.com/accounts/authsubrequest”允许的scopes=“https://www.googleapis.com/auth/buzz” [content-type]=>应用程序/ JSON; charset= UTF-8 [日期]=> Tue,2010年7月20日12:22:05 GMT [到期]=> Tue,2010年7月20日12:22:05 GMT [缓存控制]=>私有,max-age= 0 [X-Content-Type-Options]=> NoSniff [X帧选项]=>素素 [x-xss-protection]=> 1; mode=块 [服务器]=> GSE [转移编码]=>块 )
[data] => Array
(
[error] => Array
(
[errors] => Array
(
[0] => Array
(
[message] => User must have authorized this application to have the following scope in order to make this call: [https://www.googleapis.com/auth/buzz] Also , make sure your application is using the Buzz specific OAuth authorization URL.
[locationType] => header
[location] => Authorization
)
)
[code] => 401
[message] => User must have authorized this application to have the following scope in order to make this call: [https://www.googleapis.com/auth/buzz] Also , make sure your application is using the Buzz specific OAuth authorization URL.
)
)
.
)
我已在所需的config.php文件中添加了变量
'site_name' => 'example.com',
.
'oauth_consumer_key'=>'example.com', 'oauth_consumer_secret'=>'fundersecret', 'oauth_rsa_key'=>'',
有人知道我在这里可能做错了吗??
如何存储返回到数据库的令牌?由于重新启动服务器,缓存丢失,并且用户必须再次进行身份验证。
解决方案
问题是我通过的域名。而不是传递example.com我正在传递 http://example.com 。因此,请确保站点,oauth_consumer_key和域变量正常传递。