在shinyapps.io(而非Pro)中确定用户凭据

时间:2016-12-01 07:35:06

标签: r shiny

我在shinyapps.io中构建了一个简单的应用程序,并且我成功地从MySQL托管表中引入了数据。我想只显示与正在查看应用程序的用户相关的数据,并隐藏与其无关的数据。如果用户尚未登录shinyapps.io,则将返回NULL并且不会显示任何数据。从文档和搜索结果来看,似乎这可以使用session $ user完成,但仅限于Shiny Server Pro。我不认为这可以在shinyapps.io中完成,这是正确的吗?如果是这样,我的应用程序已停止运行,因为我无法沿着整个Linux / Pro路线走下去。

1 个答案:

答案 0 :(得分:4)

Thanks to Andy Kipp from RStudio for answering this via Google Groups.
"If you're running on shinyapps.io, and your application is set to private (under Users tab), when a person logs into your application the email address of the person who is logged in will be in session$user. We don't expose anything other then the email address. Again this is for private applications only. Private applications are available in the Standard plan and higher."

Good to know, took me a while to pin this down, thanks Andy.