rdrop2 icon indicating copy to clipboard operation
rdrop2 copied to clipboard

drop_auth() Throws to Local Host, Cannot Load Page

Open phillc73 opened this issue 8 years ago • 7 comments

After "Allowing" rdrop2 on Dropbox, I am re-directed to a local host page which cannot be loaded.

The URL, prior to clicking "Allow" shows the localhost re-direct:

https://www.dropbox.com/1/oauth2/authorize?client_id=mmhfsybffdom42w&scope=&redirect_uri=http%3A%2F%2Flocalhost%3A1410&response_type=code&state=axxpkm4iIq

After clicking allow I'm re-direct to http://localhost:1410 which cannot be loaded.

I confirm that I am logged into my Dropbox account.

I am using v0.7 of rdrop2, installed initially from CRAN and then from GitHub for the latest version.

My development environment is RStudio Server running on a remote Digital Ocean droplet.

My session info is:

> devtools::session_info()
Session info -------------------------------------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.2.2 (2015-08-14)
 system   i486, linux-gnu             
 ui       RStudio (0.98.1083)         
 language (EN)                        
 collate  C                           
 tz       <NA>                        

Packages -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
 package       * version   date       source                         
 DBI             0.3.1     2014-09-24 CRAN (R 3.2.2)                 
 R6              2.1.1     2015-08-19 CRAN (R 3.2.2)                 
 Rcpp            0.12.1    2015-09-10 CRAN (R 3.2.2)                 
 assertthat      0.1       2013-12-06 CRAN (R 3.2.2)                 
 chron           2.3-47    2015-06-24 CRAN (R 3.2.2)                 
 curl            0.9.3     2015-08-25 CRAN (R 3.2.2)                 
 data.table    * 1.9.6     2015-09-19 CRAN (R 3.2.2)                 
 devtools        1.8.0     2015-05-09 CRAN (R 3.2.2)                 
 digest          0.6.8     2014-12-31 CRAN (R 3.2.2)                 
 dplyr         * 0.4.3     2015-09-01 CRAN (R 3.2.2)                 
 git2r           0.11.0    2015-08-12 CRAN (R 3.2.2)                 
 htmltools       0.2.6     2014-09-08 CRAN (R 3.2.2)                 
 htmlwidgets     0.5       2015-06-21 CRAN (R 3.2.2)                 
 httpuv          1.3.3     2015-08-04 CRAN (R 3.2.2)                 
 httr            1.0.0     2015-06-25 CRAN (R 3.2.2)                 
 jsonlite        0.9.17    2015-09-06 CRAN (R 3.2.2)                 
 lpSolve       * 5.6.12    2015-09-01 CRAN (R 3.2.2)                 
 magrittr        1.5       2014-11-22 CRAN (R 3.2.2)                 
 memoise         0.2.1     2014-04-22 CRAN (R 3.2.2)                 
 mime            0.4       2015-09-03 CRAN (R 3.2.2)                 
 rdrop2        * 0.7       2015-09-22 Github (karthik/rdrop2@15e59ef)
 rhandsontable * 0.2       2015-08-25 CRAN (R 3.2.2)                 
 rstudio         0.98.1083 2015-09-08 local                          
 rstudioapi      0.3.1     2015-04-07 CRAN (R 3.2.2)                 
 rversions       1.0.2     2015-07-13 CRAN (R 3.2.2)                 
 shiny         * 0.12.2    2015-08-05 CRAN (R 3.2.2)                 
 shinyBS       * 0.61      2015-03-31 CRAN (R 3.2.2)                 
 stringi         0.5-5     2015-06-29 CRAN (R 3.2.2)                 
 stringr         1.0.0     2015-04-30 CRAN (R 3.2.2)                 
 xml2            0.1.2     2015-09-01 CRAN (R 3.2.2)                 
 xtable        * 1.7-4     2014-09-12 CRAN (R 3.2.2)  

phillc73 avatar Sep 22 '15 21:09 phillc73

Manually editing the URL to remove the redirect solved the problem. This worked:

https://www.dropbox.com/1/oauth2/authorize?client_id=mmhfsybffdom42w&scope=&response_type=code&state=axxpkm4iIq

EDIT:

When I said it solved the problem, I meant it returned a token code to me. However, this is not cached. This may be something to do with me running rstudio-server on a remote host, I don't really know.

What's the best way to manually enter this code so that it is stored correctly? After looking through the README I tried:

token <- "XYZMYCODE123"
saveRDS(token, "droptoken.rds")
token <- readRDS("droptoken.rds")
drop_acc(dtoken = token)

This results in:

Error in token$sign : $ operator is invalid for atomic vectors

I guess I need to know more about the format of the JSON response form the Dropbox API.

phillc73 avatar Sep 22 '15 22:09 phillc73

I have managed to obtain my auth key for Dropbox and am successfully using rdrop2 to send and receive files.

I think the above problem may be specific to my use case. I generally work with a remote development environment - RStudio Server hosted on a Digital Ocean droplet. I access the IDE through my web browser.

I was able to ultimately obtain my auth code after resolving https://github.com/karthik/rdrop2/issues/42 by installing devtools.

phillc73 avatar Sep 25 '15 11:09 phillc73

@phillc73 same with me, but the worse is that I installed and also load devtools cannot access as well.

> drop_acc(dtoken = '4yzKdY032ywAAAAAAAA4UIkU1EgLusjBbyEEgt_Nw_0')
- Error in token$sign : $ operator is invalid for atomic vectors

englianhu avatar Oct 08 '15 14:10 englianhu

@phillc73 same issue -- I'm using Rstudio Server using an AWS EC2 instance. I'm getting the same "Error in token$sign : $ operator is invalid for atomic vectors" message. Can you provide details on what you did after installing devtools to resolve this issue?

kollyan avatar Jul 02 '16 21:07 kollyan

+1. My RStudio server users encounter the same problem (redirect to localhost:1410, but the server is remote; there is no localhost from their perspective). Looking forward to this functionality! Thanks karthik!

dholstius avatar Sep 08 '17 21:09 dholstius

I have installed the latest version of rdrop2, version 0.8.1.9999, and I am still getting the token$sign error.

drop_acc(dtoken = "MY_TOKEN") Error in token$sign : $ operator is invalid for atomic vectors

here is my session info:

Session info -------------------------------------------------------------------------------------------------- setting value
version R version 3.3.1 (2016-06-21) system x86_64, mingw32
ui RStudio (1.1.383)
language (EN)
collate English_United States.1252
tz America/New_York
date 2017-12-14

Packages ------------------------------------------------------------------------------------------------------ package * version date source
assertthat 0.2.0 2017-04-11 CRAN (R 3.3.3)
base * 3.3.1 2016-06-21 local
bindr 0.1 2016-11-13 CRAN (R 3.3.3)
bindrcpp 0.2 2017-06-17 CRAN (R 3.3.3)
codetools 0.2-14 2015-07-15 CRAN (R 3.3.1)
curl 3.0 2017-10-06 CRAN (R 3.3.3)
data.table * 1.10.4-3 2017-10-27 CRAN (R 3.3.3)
datasets * 3.3.1 2016-06-21 local
devtools 1.13.4 2017-11-09 CRAN (R 3.3.3)
digest 0.6.12 2017-01-27 CRAN (R 3.3.3)
dplyr 0.7.4 2017-09-28 CRAN (R 3.3.3)
git2r 0.19.0 2017-07-19 CRAN (R 3.3.3)
glue 1.2.0 2017-10-29 CRAN (R 3.3.3)
graphics * 3.3.1 2016-06-21 local
grDevices * 3.3.1 2016-06-21 local
grid 3.3.1 2016-06-21 local
gtable 0.2.0 2016-02-26 CRAN (R 3.3.3)
httpuv 1.3.5 2017-07-04 CRAN (R 3.3.3)
httr 1.3.1 2017-08-20 CRAN (R 3.3.3)
janitor * 0.3.0 2017-05-06 CRAN (R 3.3.3)
jsonlite 1.5 2017-06-01 CRAN (R 3.3.3)
lubridate * 1.7.1 2017-11-03 CRAN (R 3.3.3)
magrittr 1.5 2014-11-22 CRAN (R 3.3.3)
memoise 1.1.0 2017-04-21 CRAN (R 3.3.3)
methods * 3.3.1 2016-06-21 local
mime 0.5 2016-07-07 CRAN (R 3.3.2)
openssl 0.9.9 2017-11-10 CRAN (R 3.3.3)
pkgconfig 2.0.1 2017-03-21 CRAN (R 3.3.3)
plyr * 1.8.4 2016-06-08 CRAN (R 3.3.3)
pryr * 0.1.3 2017-10-30 CRAN (R 3.3.3)
purrr 0.2.4 2017-10-18 CRAN (R 3.3.3)
R6 2.2.2 2017-06-17 CRAN (R 3.3.3)
Rcpp 0.12.14 2017-11-23 CRAN (R 3.3.3)
rdrop2 * 0.8.1.9999 2017-12-14 Github (karthik/rdrop2@32bab93) reshape2 * 1.4.3 2017-12-11 CRAN (R 3.3.3)
rlang 0.1.4 2017-11-05 CRAN (R 3.3.3)
stats * 3.3.1 2016-06-21 local
stringi 1.1.6 2017-11-17 CRAN (R 3.3.3)
stringr * 1.2.0 2017-02-18 CRAN (R 3.3.3)
tibble 1.3.4 2017-08-22 CRAN (R 3.3.3)
tidyr * 0.7.2 2017-10-16 CRAN (R 3.3.3)
tidyselect 0.2.3 2017-11-06 CRAN (R 3.3.3)
tools 3.3.1 2016-06-21 local
utils * 3.3.1 2016-06-21 local
withr 2.1.0 2017-11-01 CRAN (R 3.3.3)
yaml 2.1.15 2017-12-01 CRAN (R 3.3.3)

aousabdo avatar Dec 14 '17 19:12 aousabdo

I see this is an old issue but I'm experiencing the same as described here. Is there any clue on how to workaround it?

andreavargasmon avatar Aug 04 '21 21:08 andreavargasmon