我正在尝试使用google buzz api将一些内容发布到我的google buzz帐户。 我尝试使用他们提供的示例代码,但它给出了以下错误
Array
( [http_code] => 401 [headers] =>排列 ( [WWW-Authenticate] => AuthSub realm =“https://www.google.com/accounts/AuthSubRequest”allowed-scopes =“https://www.googleapis.com/auth/buzz” [Content-Type] =>应用/ JSON;字符集= UTF-8 [日期] =>星期二,2010年7月20日12:22:05 GMT [Expires] =>星期二,2010年7月20日12:22:05 GMT [Cache-Control] => private,max-age = 0 [X-Content-Type-Options] => nosniff [X-Frame-Options] => SAMEORIGIN [X-XSS-Protection] => 1;模式=块 [服务器] => GSE [Transfer-Encoding] =>分块 )
[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'=> 'consumersecret', 'oauth_rsa_key'=> '',
有人知道我在这里做错了什么吗?
如何存储返回数据库的令牌?因为如果重新启动服务器,则缓存将丢失,用户必须再次进行身份验证。
答案 0 :(得分:1)
问题在于我传递的域名。而不是传递example.com我传递http://example.com。因此,请确保正确传递site_name,oauth_consumer_key和域变量。