我尝试允许用户在闪亮的应用程序中连接到谷歌分析帐户(使用闪亮代理):
library(shiny)
library("googleAnalyticsR")
options(googleAuthR.verbose=2)
ui <- fluidPage(
actionButton(inputId = "go",label = "go"),
verbatimTextOutput("log")
)
server <- function(input, output, session) {
info <- reactiveValues()
observeEvent(input$go,{
message("clic")
ga_auth(new_user = TRUE)
info$account_list <- ga_account_list()
})
output$log <- renderPrint({
print(info$account_list)
})
}
shinyApp(ui, server)
此应用程序在交互式上下文中运行良好,但在使用 shinyproxy 部署时却没有出现此错误:
2018-08-31 21:01:34> No local token found in session
2018-08-31 21:01:34> Auto-refresh of token not possible, manual re-authentication required
Warning: Error in : Authentication options didn’t match existing session token and not interactive session
so unable to manually reauthenticate
78: stop
77: make_new_token
76: gar_auth
75: gar_auto_auth
74: ga_auth
73: observeEventHandler [/usr/local/lib/R/site-library/gauth/app/app.R#27]
2: shiny::runApp
1: gauth::run_app
我怎样才能允许用户登录到他的谷歌分析帐户?
我的工作在这里:https ://github.com/VincentGuyader/gauth
(Dockerfile、application.yml 和源代码)
问候