title: How to prevent users to visit R shiny app through URL directly?
body: <p>I have a parent website, which has hundreds of users with their password and account registered already.  </p>
  
  <p><a href="https://i.stack.imgur.com/Jqk9Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jqk9Q.png" alt="enter image description here"></a></p>
  
  <p>I have many R shiny apps on the site and I don't want users to visit apps through URL directly. How can I achieve this (maybe bind the parent site's url to shiny app)? A minimal shiny app example as below, thanks in advance: </p>
  
  <pre><code>n &lt;- 200
  # Define the UI
  ui &lt;- bootstrapPage(
    numericInput('n', 'Number of obs', n),
    plotOutput('plot')
  )
  
  # Define the server code
  server &lt;- function(input, output) {
    output$plot &lt;- renderPlot({
      hist(runif(input$n))
    })
  }
  
  # Return a Shiny app object
  shinyApp(ui = ui, server = server)
  </code></pre>