php - 如何获取推特的用户访问 token ?

标签 php twitter twitter-oauth

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

在两个页面上替换我的消费者 key 和 secret 消费者 key 之后。我将它上传到我的服务器上,但是当我打开 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

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

最佳答案

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

The new interface simplifies this: if you provide a placeholder callback URL in the field for it in your application detail screen, it allows you to use dynamic callbacks. So just go ahead and put a placeholder in there (doesn't have to be the actual dynamic/runtime callback you use) and you'll be able to use other forms of auth.

When no placeholder is presented, the application is locked to OOB mode.

关于php - 如何获取推特的用户访问 token ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33529917/

相关文章:

php - 内容变化的分页

php - 如何使用 Magento Core API 为特定用户获取购物车?

Php 选择每一种

javascript - Twitter JavaScript OAuth : Get Access Token without Server Side

python - Tweepy "page parameter is invalid"错误

ruby - 尝试使用Oauth 1.0获取Twitter request_token的过程中,始终出现 '215 Bad Authentication'错误

phpMyAdmin MySQL 时间戳显示尾随零

angularjs - Ionic 框架 Twitter 集成

ajax - 使用 jQuery $.ajax 调用 Twitter API 1.1 搜索

php - 用于创建选项卡的自定义简码