artemklevtsov / RGA

A Google Analytics API client for R
http://cran.r-project.org/package=RGA
32 stars 13 forks source link

"Error in : oauth_listener() needs an interactive environment" again #54

Open MarekLu opened 6 years ago

MarekLu commented 6 years ago

I use RGA in Shiny web application: I authorize it using my client.id and client.secret:

  1. R Studio creates local file-token .myemail-token.rds, I must confirm it in web browser for the first time.
  2. R Studio need no authorization next times, it uses locally saved token everytime.
  3. When I copy all R scripts and token to Shiny FTP and run the app from web browser, it needs authorization again. This is error from JS console:
Access token will be stored in the '.myemail-token.rds' file.
Warning: Error in : oauth_listener() needs an interactive environment.
Stack trace (innermost first):
    44: oauth_listener
    43: init_oauth2.0
    42: self$init_credentials
    41: public_bind_env$initialize
    40: Token2.0$new
    39: oauth2.0_token
    38: authorize
     1: runApp
Error : oauth_listener() needs an interactive environment.

I've read the https://github.com/artemklevtsov/RGA/issues/20, I make everything like in this issue, but no effect, still the same error.

Can you give me an advice please?

jdeboer commented 6 years ago

Have you considered using a Google API service account instead? Here's a link to an explanation on Stack Overflow: https://stackoverflow.com/a/38301278/1007029

MarekLu commented 6 years ago

Unfortunately I can not use Service Acccount with these Google Analytics accounts. Corporate policy...