AyeTown
AyeTown

Reputation: 905

Connecting R Shiny app to Dropbox not working

This is literally driving me mad and I've been working on it for so long that I figured I'd post my issue on here. Any help is appreciated!

The problem: I created a basic Dropbox account. I have a Shiny application and would like to use a stored data file from Dropbox within the app. I followed the steps to create an application on Dropbox and set the app to require full access to my files. I then ran the code below in R:

drop_auth(new_user = TRUE,key = "key",secret = "secret",cache = TRUE)

where key and secret are the actual key and secret for my application. A web browser is opened in Chrome with the error below.

enter image description here

I have looked up solutions online, however, none of them provides a clear enough explanation for me to follow along (obviously I am lacking knowledge). Can someone pleeeease help me with this. Thanks!

Upvotes: 1

Views: 881

Answers (1)

Simon
Simon

Reputation: 1111

You haven't provided much code to work on here but I'm assuming you're using rdrop2? In your code above, you've provided several arguments to drop_auth() but, as per the package's documentation, run drop_auth() with no arguments - this should open a browser window and allow you to authorise the connection:

library(rdrop2)
drop_auth()

### PINCHED FROM RDROP2 DOCUMENTATION ###

# This will launch your browser and request access to your Dropbox account. You will be prompted to log in if you aren't already logged in.
# Once completed, close your browser window and return to R to complete authentication. 
# The credentials are automatically cached (you can prevent this) for future use.

# If you wish to save the tokens, for local/remote use

token <- drop_auth()
saveRDS(token, file = "token.rds")

# Then in any drop_* function, pass `dtoken = token
# Tokens are valid until revoked.

If you have multiple Dropbox accounts, I recommend signing out of all of them prior to running the above code. When the browser window launches, it should then ask you to sign in to the account you need and complete the authentication process.

Upvotes: 2

Related Questions