0

I have a Shiny application that uses the Instagram API, and needs an access token. When running locally, I am able to use

full_url <-oauth_callback()
full_url <- gsub("(.*localhost:[0-9]{1,5}/).*", x=full_url, replacement="\\1")
print(full_url)

to get the callback url to register with Instagram. How would I go about getting this url when my application is deployed?

Additionally, and this might be related, when the app is deployed I get an error that:

Error : oauth_listener() needs an interactive environment

I never explicitly use oauth_listener(), so I'm not sure how to counteract this. All of my oauth related code is as follows:

  instagram <- oauth_endpoint(
    authorize="https://api.instagram.com/oauth/authorize",
    access="https://api.instagram.com/oauth/access_token",)
  my_app <- oauth_app(app_name, client_id, client_secret)
  ig_oauth <- oauth2.0_token(instagram, my_app, scope="basic",  type="application/x-www-form-urlencoded", cache=FALSE)
rkade93
  • 3
  • 4
  • Maybe try client-side/implicit auth? http://instagram.com/developer/authentication/ – hadley Oct 16 '14 at 11:01
  • Also, what's the point of the regexp? – hadley Oct 16 '14 at 11:02
  • I'll look into the client-side authorization. This is my first experience with using authentication in R, and I was working off of a tutorial for integrating Instagram. I believe the regexp is simply to clean the URL, although it does not seem necessary. – rkade93 Oct 16 '14 at 14:26
  • After studying the Instagram API, I found out that I can accomplish what I want by using my client_id, and I don't have to work with authentication at all – rkade93 Oct 16 '14 at 15:58

0 Answers0