-
Notifications
You must be signed in to change notification settings - Fork 12
Latest httr changes to OAuth breaks rfigshare? #70
Comments
Yeah, it broke stuff in |
@sckott thanks, can you link me to an example of the changes you had to make? Might speed up my debugging. Were the changes backwards compatible with earlier httr builds? |
@cboettig It did break rgauges right away (only noticed because I was trying to get some metrics for Josh). Just tried with
|
So Just had to change https://github.com/ropensci/rgauges/blob/a0cc44986b18e031a3158f1a1f31426be6f561f7/R/me.R#L14 GET(url=url, config=list(httpheader=paste0('X-Gauges-Token: ',key)) To this https://github.com/ropensci/rgauges/blob/master/R/gs_me.R#L15 GET(url=url, add_headers('X-Gauges-Token' = key)) and I do Apparently |
@karthik weird, I'm also running fs_auth()
Error: Deprecated: supply token object to config directly
Enter a frame number, or 0 to exit
1: fs_auth()
2: sign_oauth1.0(myapp, token = token, token_secret = token_secret) |
other attached packages:
[1] httr_0.3 rfigshare_0.2-8 devtools_1.4.1.99 knitr_1.5 plyr_1.8.1
[6] reshape2_1.2.2 ggplot2_0.9.3.1 coyote_0.1 > fs_auth()
Error: Deprecated: supply token object to config directly
Very odd. So my Macbook Pro, i.e. couch laptop (where I tried earlier) is |
We should definitely talk about this at the hack-at-it. I think the new caching system in httr will eliminate some of the hassle here, and there are some larger architectural patterns that I think you'd benefit from. |
Sounds awesome, looking forward to it. Meanwhile, anything about the OAuth1 error on upgrading to R 3.0.3 sound Carl Boettiger sent from mobile device; my apologies for any terseness or typos
|
I don't understand how it couldn't currently be triggering errors since that function no longer works (ever). (But I think I have a way to make it work, let me try today) |
@hadley Looks like it's been too long since I looked at the httr interface! When I started this package the command was still called The new mechanism with caching looks great. I see you have the function I realize your caching of tokens avoids having to repeat the handshake, something we were accomplishing before by just storing the token and private token along with the key and secret key in Also, when I try the new request <- "request_token"
authorize <- "authorize"
access <- "access_token"
base_url <- "http://api.figshare.com/v1/pbl/oauth"
endpoint <- oauth_endpoint(request, authorize, access, base_url=base_url)
# endpoint <- oauth_endpoint(NULL, authorize, access, base_url=base_url) # tried this too since docs say oauth 1 doesn't need a request token? a bit confused, no dice.
myapp <- oauth_app("rfigshare", key = cKey, secret=cSecret)
token <- oauth1.0_token(endpoint, myapp) This takes me to the figshare website where I sign in and click "allow" as expected, then R gives me the error:
Thanks much for any help or hints! |
Just pushed a fix, so that you can use myapp <- oauth_app("rfigshare",
key = getOption("FigshareKey"),
secret = getOption("FigsharePrivateKey"))
oauth <- sign_oauth1.0(myapp, token = getOption("FigshareToken"),
token_secret = getOption("FigsharePrivateToken"))
r <- GET("http://api.figshare.com/v1/my_data/articles", oauth)
stop_for_status(r) |
@cboettig Hmmm, that error you're seeing is because I'm using a GET and figshare wants a POST (which I see is what the spec encourages, but doesn't require) |
I just pushed a fix - let me know if if works for you (it works for me with figshare, twitter and vimeo) |
@hadley awesome; working for me as well, thanks much for the quick fix. |
Hmm, this was working this morning, and now I'm getting the error: > fs_auth()
Error: cache should be length 1 vector with trace
No idea what is causing this, seems to be related to httr's own caching getting confused with the already stored crendentials? @hadley @karthik can you replicate this error or have any ideas what might be going on here? My sessionInfo:
|
Just a second ago: > library(rfigshare)
> fs_auth()
Authentication successful My session Info: > sessionInfo()
R version 3.0.3 (2014-03-06)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] graphics grDevices datasets stats utils methods base
other attached packages:
[1] rfigshare_0.2-8 devtools_1.4.1.99 knitr_1.5 plyr_1.8.1
[5] reshape2_1.2.2 ggplot2_0.9.3.1 coyote_0.1
loaded via a namespace (and not attached):
[1] colorspace_1.2-4 dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1
[5] formatR_0.10 grid_3.0.3 gtable_0.1.2 httr_0.3
[9] labeling_0.2 MASS_7.3-30 memoise_0.1 munsell_0.4.2
[13] parallel_3.0.3 proto_0.3-10 RColorBrewer_1.0-5 Rcpp_0.11.1
[17] RCurl_1.95-4.1 RJSONIO_1.0-3 scales_0.2.3 stringr_0.6.2
[21] tools_3.0.3 whisker_0.3-2 XML_3.95-0.2 yaml_2.1.11 |
Have you tried installing |
Yes, I did and it worked this morning just fine... Perhaps in doing so it Carl Boettiger sent from mobile device; my apologies for any terseness or typos
|
Whoops, was testing with the rfigshare branch in which I had already tried migrating to the |
I think @hadley mentioned some changes to OAuth in httr he wanted folks to test recently. I installed the current github
httr
locally and now cannot authenticaterfigshare
. @karthik or @emhart can you check/confirm if you can still authenticate rfigshare with the latesthttr
build? Thanks.The text was updated successfully, but these errors were encountered: