So far, we have learned how to develop a Shiny application. Since the application is exposing so much data to the outside world, it needs to be protected by unauthorized means. For that, we can provide password authentication. Shiny provides a control for achieving this task, called passwordInput (https://shiny.rstudio.com/reference/shiny/latest/passwordInput.html):
passwordInput(inputId, label, value = "", width = NULL,placeholder = NULL)
Let's see an example with passwordInput:
ui <- fluidPage( passwordInput("password", "Password:"), actionButton("go", "Go"), verbatimTextOutput("value") ) server <- function(input, output) { output$value <- renderText({ req(input$go) isolate(input$password) }) }
Here is the output:
In the preceding application...