作者:popou | 来源:互联网 | 2023-05-19 02:25
I am using the httr
v0.2 package to use the github api as well now. But I am struggling to get past the oauth2.0(...)
part in which I get to the browser page for my app, click on 'Allow' and then get redirected to the callback URL page.
我现在也在使用httr v0.2包来使用github api。但是,我正在努力克服oauth2.0(…)的部分,我在其中找到了我的应用程序的浏览器页面,点击“允许”,然后被重定向到回调URL页面。
The httr github demo suggests using the callback URL as http://localhost:1410
but when I get redirected to that page, google chrome suggests that it could not connect to the page and the page it is getting re-directed to is http://localhost:1410/?error=redirect_uri_mismatch&state=DZNFcm8tnq
...so I tried a bunch of other ports and overall URLS to no success...
httr github演示程序建议使用回调URL作为http://localhost:1410,但是当我被重定向到该页面时,谷歌chrome建议它不能连接到该页面,它正在被重定向到的页面是http://localhost:1410/?error=redirect_uri_mismatch&state= dznfcm8q…所以我尝试了一些其他的端口和url,但没有成功。
What would be another callback URL and URL that would work?
另一个回调URL和URL是什么?
below is the code I used
下面是我使用的代码。
require(httr)
## Loading required package: httr
github.app <- oauth_app("github","xxxxx", "xxxxxxxxxxxxxxx")
github.urls <- oauth_endpoint(NULL, "authorize", "access_token",base_url = "https://github.com/login/oauth")
github.token <- oauth2.0_token(github.urls,github.app)
## Loading required package: Rook
## Loading required package: tools
## Loading required package: brew
## starting httpd help server ... done
## Waiting for authentication in browser...
which is when I get directed to a page that has the 'Allow' button whichIi click after which I get redirected to the page in google chrome that cannot connect to localhost :1410
当我被指向一个有“允许”按钮的页面时,点击之后,我就会被重定向到无法连接到localhost:1410的谷歌chrome中的页面
4 个解决方案