[英]LinkedIn API error of redirect uri from httr
我正在尝试使用 R 和httr
package 访问 LinkedIn 的 API。
当我执行最后一个oauth2.0_token()
function 以获取授权令牌时,我从 LinkedIn 收到以下错误: "The redirect_uri does not match the registered value"
。
我已在 LinkedIn 开发人员网站上将重定向的 url 设置为http://my_app_54321
有谁知道解决方案是什么?
# Packages
library(httr)
# Client info
clientid <- "my_id"
secret <- "my_secret"
# App
app <- oauth_app(appname = "app name", key = clientid, secret = secret)
# Endpoints
endpoint <- oauth_endpoint(base_url = "https://www.linkedin.com/uas/oauth2",
authorize = "authorization", access = "accessToken")
# Access token
token <- oauth2.0_token(endpoint = endpoint, app = app)
token
将my redirected url
更改为以下解决了它,因为我只需要应用程序在本地运行。
http://localhost:1410/
来自 httr package 的httr
的评论指向了这个方向:
https://github.com/r-lib/httr/blob/master/demo/oauth2-linkedin.r
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.