r - 卡在 Twitter 授权的 "Redirecting you back to the application. This may take a few moments."部分 - 使用 twitteR 包

标签 r authentication twitter

我遇到了与 this question 中描述的完全相同的问题,其中我遇到了类似的错误。但我按照说明进行操作,更改了回调网址,然后出现了新问题。我通过浏览器进入授权部分,但我一直卡在加载页面上,并出现警告“正在将您重定向回应用程序。这可能需要一些时间。”并且没有被重定向,浏览器停止并警告它无法访问该页面 - 而且,RStudio 在它之后立即崩溃。我应该怎么办?我尝试搜索类似的问题,但一直找不到解决方案。

虽然这有点重复,但这是 R 中的代码:

library(twitteR)

Consumer_key <- "key"
Consumer_secret <- "secret"

setup_twitter_oauth(Consumer_key,Consumer_secret, access_token=NULL,access_secret=NULL)

[1] "Using browser based authentication"
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort

最佳答案

我遇到了这个问题,但在 Node.js 中,这是因为 Twitter 完成身份验证后我没有调用护照回调函数

不确定这是否有帮助,但解决方法如下。

passport.use(new TwitterStrategy({
    consumerKey: process.env.TWITTER_CONSUMER_KEY,
    consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
    callbackURL: "http://127.0.0.1:8080/passport/twitter/callback"
}, function(token, tokenSecret, profile, cb) {
    // debug(token);
    // debug(tokenSecret);
    // debug(profile);
    cb(); // Was missing this line
}));

关于r - 卡在 Twitter 授权的 "Redirecting you back to the application. This may take a few moments."部分 - 使用 twitteR 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46309181/

相关文章:

r - flextable 对象第一列的缩进

r - 如何计算每组中唯一名称的数量

r - 手动安装额外的 R 构建工具

r - dplyr 中的 mutate_each 不能在数据帧上按列工作

android - 如何创建可以与所有客户端一起使用的 android 共享 Intent ?

android - Android 上的 Twitter API 实现

asp.net-mvc - .net MVC Controller 操作方法的属性

authentication - 无需 Kerberos 或 AD/LDAP 的 Hbase 身份验证

http - Bearer (JWT) 身份验证方案的身份验证信息 header

ssl - 我如何使用 Pharo 获取 Twitter 提要?