0

I am trying in earnest to get my flexdashboard (Markdown) to run with password parameters. I have gone through multiple iterations and the closest I have got is having a dialgueModule appear when navigating to the markdown.

My current code runs iterations like so.

---
title: "MyMarkdown_v1"
date: "January 10, 2019"
output: html_document
params:
  password: pw<-getPass(msg = "Enter the Password, please!")

---

```{r global, echo=FALSE}
rmarkdown::render("SecretDocument.Rmd", params=list(pass=pw))

This successfully calls the parameters, but online in the IDE (when using 'Knit with parameters'). It then works as desired, calling the .Rmd file I want authorized users to have access to.

However, it appears that, once published (outside the IDE) the page renders the .Rmd file without parameters. I looked here and here. But it appears that rendering .Rmd files with parameters requires a paid service (e.g. RStudio Connect). Is that true? If not, how do I get the document to open with a getPass requirement on the web (i.e. RPubs)

Of course, if anyone knows how to pass authentication (ie password) requirements in flexdashboard directly, that would be awesome.

OctoCatKnows
  • 399
  • 3
  • 17
  • Update-not sure if its a ‘fix’. I can use two .Rmd files and have the first pass a getPass function to render the second. However, I still have to park the actual pw in the document which isn’t preferable . Is there a better option than substr for checking user input? – OctoCatKnows Jan 11 '19 at 02:25
  • If you render the document in an environment that does not explicitly pass `params`, then the document uses what you have assigned in the yaml header. One trick I do (to prevent something like this) is to put in dummy variables in the yaml and look for those constants in the first block. Since you want to "mandate" that params are passed, this is one way to enforce that, as you can instantly know that `params` were or were not passed. – r2evans Jan 24 '19 at 22:40

0 Answers0