I am trying to use Dropbox for remote storage for a R shiny app. In the good old days you used to be able to get a long-lasting token via the rdrop2 package, but sadly that has not kept up with dropbox's migration to short-lived tokens and refresh tokens.
So, I am trying to get this done with the Oauth_ family of functions in the httr package.
I know that my dropbox auth URL needs to end up looking like: https://www.dropbox.com/oauth2/authorize?client_id=APP_KEY&token_access_type=offline&response_type=code
with the token_access_type=offline
being the important bit for attaining the refresh token
my code, so far, looks like this:
dropbox_endpoint <- httr::oauth_endpoint(authorize = "https://www.dropbox.com/oauth2/authorize",
access = "https://api.dropbox.com/oauth2/token")
dropbox_app <- httr::oauth_app(appname="MY APP NAME", key = "APP_KEY",
secret = "SECRET")
dropbox_token <- httr::oauth2.0_token(endpoint=dropbox_endpoint, app=dropbox_app,
cache = TRUE)
Where in this code do I put token_access_type=offline
?? I have tried a few options, but I am now just driving myself insane...