This seems related to #208, but since it appears to be different I'm making a new issue.
I installed the dev version from Github, and the issue still occurs. Note that I also experienced #324 as my comment outlines. I have used that monkey patch to approach this point.
I'm trying to work through the Facebook demo. One of the lines is the GET request. The problem is that I receive an error.
# fb_app setup as in the demo: https://github.com/hadley/httr/blob/master/demo/oauth2-facebook.r#L10.
fb_token <- oauth2.0_token(oauth_endpoints("facebook"), fb_app, cache = F)
GET("https://graph.facebook.com/me", config(token = "fb_token"))
> Error in token$sign : $ operator is invalid for atomic vectors
The problem appears to be in the Token2.0 class. In brief, there's this line:
Authorization = paste('Bearer', self$credentials$access_token))
Unfortunately, for me, while I have a successful access token the fb_token$credentials, it looks like this:
> fb_token$credentials
[1] "access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&expires=5161857"
This is obviously not parsed out.
I can work around this issue by patching the $credentials value to have an $access_token value, i.e.
parsed_creds <- httr::parse_url(paste0("http://localhost/?", fb_token$credentials))
fb_token$credentials <- parsed_creds$query
req <- GET("https://graph.facebook.com/me", config(token = fb_token), verbose())
This completes fine, and returns the expected results.
This seems related to #208, but since it appears to be different I'm making a new issue.
I installed the dev version from Github, and the issue still occurs. Note that I also experienced #324 as my comment outlines. I have used that monkey patch to approach this point.
I'm trying to work through the Facebook demo. One of the lines is the GET request. The problem is that I receive an error.
The problem appears to be in the
Token2.0class. In brief, there's this line:Unfortunately, for me, while I have a successful access token the
fb_token$credentials, it looks like this:This is obviously not parsed out.
I can work around this issue by patching the
$credentialsvalue to have an$access_tokenvalue, i.e.This completes fine, and returns the expected results.