【问题标题】:How to get twitter's user Access Token?如何获取 twitter 的用户访问令牌?
【发布时间】:2016-02-05 10:09:45
【问题描述】:

我在一些 PHP 页面中使用https://twitteroauth.com/。我想获取用户访问令牌和访问秘密令牌。我在这个页面上得到了答案:How to get user Access Token and Access Secret with the Twitter API using php

在两个页面上替换我的消费者密钥和秘密消费者密钥后。我将它上传到我的服务器上,但是当我打开 twitter-go.php 时出现以下错误

Fatal error: Uncaught exception `'Abraham\TwitterOAuth\TwitterOAuthException'` with message 

'<?xml version="1.0" encoding="UTF-8"?>
<hash> 
    <error>Desktop applications only support the oauth_callback value 'oob'</error>
    <request>/oauth/request_token</request>
</hash> '
in `/home/mediahyp/public_html/tweetme/twitteroauth/src/TwitterOAuth.php:138` 

Stack trace: 

#0 /home/mediahyp/public_html/tweetme/twitter-go.php(13): Abraham\TwitterOAuth\TwitterOAuth->oauth('oauth/request_t...', Array) 
#1 {main} thrown in /home/mediahyp/public_html/tweetme/twitteroauth/src/TwitterOAuth.php on line 138

谁能告诉我这个错误是关于什么的?我错过了什么或其他什么。

【问题讨论】:

    标签: php twitter twitter-oauth


    【解决方案1】:

    https://twittercommunity.com/t/desktop-applications-only-support-the-oauth-callback-value-oob-oauth-request-token/252/2

    新界面简化了这一点:如果您在应用程序详细信息屏幕的字段中为其提供占位符回调 URL,它允许您使用动态回调。因此,只需在其中放置一个占位符(不必是您使用的实际动态/运行时回调),您就可以使用其他形式的身份验证。

    当没有显示占位符时,应用程序被锁定为 OOB 模式。

    【讨论】:

    • 注释 - “twitteroauth.com 桌面应用程序仅支持 oauth_callback 值”在 Google 中发现这是最重要的结果。
    猜你喜欢
    • 1970-01-01
    • 2013-03-30
    • 2015-04-17
    • 1970-01-01
    • 1970-01-01
    • 2012-04-28
    • 2011-12-12
    • 2014-05-05
    • 2012-01-12
    相关资源
    最近更新 更多