我想创建一个需要连接到 OSM api(使用 OAuth 2.0)的包,但我有一个重定向 URI 问题
目前我使用以下 R 脚本
library(httr)
oauth_callback()
#> [1] "http://localhost:1410/"
oauth2.0_token(
endpoint = oauth_endpoint(
authorize = "https://master.apis.dev.openstreetmap.org/oauth2/authorize",
access = "https://master.apis.dev.openstreetmap.org/oauth2/token"
),
app = oauth_app(
"openstreetmap",
key = "KEY",
secret = "SECRET"
),
scope = "read_prefs"
)
创建于 2023-03-22 与 reprex v2.0.2
于是我在OAuth 2.0申请注册表中填写了oauth_callback()返回的地址(需要https)
httr 在运行 oauth2.0_token() 时打开的页面显示了一个.
最终的想法是构建一个依赖OSM API的包,所以我们需要想办法让url固定在同一台电脑上。