Hello,
Thank you very much to your team effort for a great development and service because Shiny and RStudio are very helpful in moving local R scripts to the web!
I posted this question on StackOverflow, OAuth (from“httr”) to LinkedIn on a Shiny server, and here because of the use of multiple packages.
I apologize for cross posting the question between different sites because I thought that I may receive a Shiny answer if I posted here. If there is a solution, feel free to share it as an answer on SO as well.I’m trying to connect to the LinkedIn API using OAuth from the 'httr' library on a 'Shiny' server. I have wrapped the locally working OAuth example from GitHub/hadley/httr, with a Shiny client ui and server side. I get the client ui working.
library(shiny)
shinyUI(pageWithSidebar(
sidebarPanel (
textInput("userEmail", "Your email address:", value =""),
submitButton("Grant Permission")
),
mainPanel()
))
But, the serve side doesn't open a browser for authentication.
library(shiny)
library(httr)
shinyServer(function(input, output) {
output$GrantPermission <- reactive ({
linkedin <- oauth_endpoint("requestToken", "authorize", "accessToken", base_url = "https://api.linkedin.com/uas/oauth/")
myapp <- oauth_app("linkedin", key = "abc", secret = "def")
token <- oauth1.0_token(linkedin, myapp)
sig <- sign_oauth1.0(myapp, token$oauth_token, token$oauth_token_secret)
save.image(paste(input$userEmail, ".RData"))
})
})
session Info: R version: 2.15.3 Platform: x86_64-pc-linux-gnu Packages: httr_0.2; shiny_0.8.0.99.
Any clue about what might be the problem?