【发布时间】:2018-08-09 12:13:36
【问题描述】:
我在 Shiny 上创建了非常基本和原始的授权。它只是检查服务器端的用户名-密码对,并有条件地显示隐藏界面。
使用这种原始授权有什么缺点?
library(shiny)
ui <- fluidPage(uiOutput("auth"))
server <- function(input, output) {
output$auth <- renderUI({
tagList(
textInput(inputId = "username",label = "Username"),
passwordInput(inputId = "userpassword",label = "Password"),
actionButton("userlogin", "Login")
)})
observeEvent(input$userlogin, {
if(input$username=="demo" & input$userpassword=="demo") {
output$auth <- renderUI({
tagList(
textInput(inputId = "Secret",label = NULL, placeholder = "Secret Data...")
)})
}
})
}
shinyApp(ui = ui, server = server)
【问题讨论】:
标签: r security authentication shiny authorization