I am new to the world of API calls and I was trying to connect to some of the social media APIs using HTTR package in R. All the demos suggest using callback URL as localhost port 1410. Can some one please explain to me what is so special about port 1410. The reason I ask is because I am unable to deploy an app over shinyapps.io which does not allow listening on port 1410 and works on port 80.
How can I deploy and app on shinyapps.io and make regular authentication calls to social sites like facebook (RFacebook) or Linkedin (RLinkein) etc.
I came across this issue, and found this question. Since I figured out the answer, I'm going to put it here.
The signature of the oauth_app
function is
oauth_app(appname, key, secret = NULL, redirect_uri = oauth_callback())
If you want the callback URL to be, say, at port 100, you can just pass redirect_uri = "http://localhost:100/"
.
By the way, here is the source code for oauth_callback
:
function ()
{
paste0("http://", Sys.getenv("HTTR_SERVER", "localhost"),
":", Sys.getenv("HTTR_SERVER_PORT", "1410"), "/")
}
This is why the callback URL defaults to 1410. This also means that the port can be changed by setting the HTTR_SERVER_PORT
environment variable to the desired port number (and not passing the redirect_uri
argument).