OAuth (from “httr”) to LinkedIn on a Shiny server

190 views
Skip to first unread message

Hjyah

unread,
Nov 15, 2013, 2:42:59 AM11/15/13
to shiny-...@googlegroups.com

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?

em...@xpertly.in

unread,
Aug 27, 2016, 5:50:10 AM8/27/16
to Shiny - Web Framework for R
Any luck with this? I think this is an issue with interactive mode being on. Not sure if it can be turned off somehow. 
Reply all
Reply to author
Forward
0 new messages