0

我正在尝试使用 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] => application/json; charset=UTF-8 [Date] => 2010 年 7 月 20 日星期二 12:22:05 GMT [过期] => 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; mode=block [Server] => GSE [Transfer-Encoding] => chunked )

[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' => '',

有人知道我在这里可能做错了什么吗?

如何存储返回到数据库的令牌?因为如果服务器重新启动,缓存会丢失,用户必须再次进行身份验证。

4

1 回答 1

1

问题在于我正在传递的域。而不是通过 example.com 我通过http://example.com。因此,请确保正确传递了 site_name 、 oauth_consumer_key 和域变量。

于 2010-07-22T12:11:20.677 回答