I have created very basic and primitive authentication on Shiny. It just checks the userid-password pair in the server side and conditionally shows the hidden interface.
What could be the downsides of using such primitive authorization?
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)
Note: I asked the same question in Stack Overflow. However, I had to repost here after three days since it is not replied yet. I'll update both posts after I get a solution.