New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth 1.0 encoding of parameters #21

yannabraham opened this Issue Sep 3, 2012 · 3 comments


None yet
2 participants

yannabraham commented Sep 3, 2012

it looks like there is a problem connecting to the fitbit api using the oauth1.0 method: after tokens are retrieved from the api, all calls are rejected with an invalid signature error.

It seems that the issue is with the oauth_signature function using curlEscape, while the OAuth 1.0 specification requires curlPercenEncode (see for details).

Changing the code solves the issue for the fitbit site, although I could not test whether this breaks anything for other api .


This comment has been minimized.


hadley commented Sep 4, 2012

Could you provide a reproducible example? That'll help me develop a test case etc.


This comment has been minimized.

yannabraham commented Sep 4, 2012


key <- '<edited>'
secret <- '<edited>'
tokenURL <- ''
accessTokenURL <- ''
authorizeURL <- ''

fbr <- oauth_app('fitbitR',key,secret)
fitbit <- oauth_endpoint(tokenURL,authorizeURL,accessTokenURL)

token <- oauth1.0_token(fitbit,fbr)
sig <- sign_oauth1.0(fbr,

dta <- GET("",sig)
# this will fail unless using curlPercentEncode

is it ok if I send you key, secret, token and the like through a separate email?


This comment has been minimized.


hadley commented Sep 4, 2012

Following that link to suggests that even curlPercentEncode isn't quite right. I'll probably write my own to guarantee that it's correct.

@hadley hadley closed this in 71c45f1 Sep 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment