[英]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.