谷歌嗡嗡声API错误

发布于 2024-09-10 11:19:24 字数 1957 浏览 7 评论 0原文

我正在尝试使用 Google Buzz API 将一些内容发布到我的 Google Buzz 帐户。 我尝试使用他们提供的示例代码,但它给出了以下错误

Array

( [http_code] => 401 [标题] =>大批 ( [WWW-验证] => AuthSub 领域 =“https://www.google.com/accounts/AuthSubRequest”允许范围 =“https://www.googleapis.com/auth/buzz” [内容类型] =>应用程序/json;字符集=UTF-8 [日期] => 2010 年 7 月 20 日星期二 12:22:05 GMT [过期] => 2010 年 7 月 20 日星期二 12:22:05 GMT [缓存控制] =>私人,最大年龄=0 [X-内容类型-选项] =>不闻 [X 框架选项] =>同源 [X-XSS-保护] => 1;模式=块 [服务器] =>通用电气工程师协会 [传输编码] =>分块的 )

[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' =>; “消费者的秘密”, 'oauth_rsa_key' =>; '',

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

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

I am trying to post some content to my google buzz account using google buzz api.
I tried using their sample code that they have provided ,but it give the below error

Array

(
[http_code] => 401
[headers] => Array
(
[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] => Tue, 20 Jul 2010 12:22:05 GMT
[Expires] => Tue, 20 Jul 2010 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.
            )

    )

)

i have added the variables in the config.php file which were required

'site_name' => 'example.com',

'oauth_consumer_key' => 'example.com',
'oauth_consumer_secret' => 'consumersecret',
'oauth_rsa_key' => '',

Does anybody know what i might be doing wrong here??

How can i store the tokens that are returned to the database?? Since if the server is restarted the cache is lost and the users have to authenticate again.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叫思念不要吵 2024-09-17 11:19:24

问题出在我传递的域上。我没有传递 example.com,而是传递 http://example.com 。因此,请确保 site_name 、 oauth_consumer_key 和域变量正确传递。

The issue was with the domain that i was passing. Instead of passing example.com i was passing http://example.com . So make sure the site_name , oauth_consumer_key and domain variables are passed properly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文