Open ffalcolini opened 4 years ago
I am also interested in this. Thanks
I have made several attempts, but I cannot use shiny manager with flex dashbaord.
If we suppose we have this flexdashboard code:
---
title: "Multiple Pages"
output: flexdashboard::flex_dashboard
---
Page 1
=====================================
### Chart 1
### Chart 2
Page 2
=====================================
### Chart 1
### Chart 2
how should I put shinymanager in the code?
Thanks a lot for your cooperation
I am also interested in this. Did you figurate out how to do it?
Perhaps some answer on #25 ?
First, you can't use shinymanager
in flexdashboard without the option runtime: shiny
, and so document must be deployed using shiny-server
This is one solution :
---
title: "Old Faithful Eruptions"
output:
flexdashboard::flex_dashboard:
css: inst/assets/styles-auth.css
runtime: shiny
---
You need to add a css file with at least this content (here in inst/assets/styles-auth.css) :
.panel-auth {
position: fixed;
top:0;
bottom: 0;
left: 0;
right: 0;
background-color: #FFF;
opacity: 1;
z-index: 99997;
overflow-x: hidden;
overflow-y: scroll;
}
Then in global
chunk, load shinymanager
and define credentials :
```{r global, include=FALSE}
# load data in 'global' chunk so it can be shared by all users of the dashboard
library(datasets)
library(shinymanager)
data(faithful)
# define some credentials (you can also use sqlite database)
credentials <- data.frame(
user = c("shiny", "shinymanager"),
password = c("azerty", "12345"),
stringsAsFactors = FALSE
)
Finally, anywhere, call the two modules :
auth_ui(id = "auth")
auth <- callModule(
module = auth_server,
id = "auth",
check_credentials = check_credentials(credentials) # data.frame
# check_credentials = check_credentials("path/to/credentials.sqlite", passphrase = "supersecret") # sqlite
)
Full example :
---
title: "Old Faithful Eruptions"
output:
flexdashboard::flex_dashboard:
css: inst/assets/styles-auth.css
runtime: shiny
---
```{r global, include=FALSE}
# load data in 'global' chunk so it can be shared by all users of the dashboard
library(datasets)
library(shinymanager)
data(faithful)
# define some credentials (you can also use sqlite database)
credentials <- data.frame(
user = c("shiny", "shinymanager"),
password = c("azerty", "12345"),
stringsAsFactors = FALSE
)
Waiting time between eruptions and the duration of the eruption for the Old Faithful geyser in Yellowstone National Park, Wyoming, USA.
selectInput("n_breaks", label = "Number of bins:",
choices = c(10, 20, 35, 50), selected = 20)
sliderInput("bw_adjust", label = "Bandwidth adjustment:",
min = 0.2, max = 2, value = 1, step = 0.2)
renderPlot({
hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks),
xlab = "Duration (minutes)", main = "Geyser Eruption Duration")
dens <- density(faithful$eruptions, adjust = input$bw_adjust)
lines(dens, col = "blue")
})
auth_ui(id = "auth")
auth <- callModule(
module = auth_server,
id = "auth",
check_credentials = check_credentials(credentials) # data.frame
# check_credentials = check_credentials("path/to/credentials.sqlite", passphrase = "supersecret") # sqlite
)
I tested the last solution of @bthieurmel but it does not work. It just shows an empty flexdashboard. Do you have any ideas why it does not show anything?
Hi,
I test this solution, it work, but when I run this on shiny, I saw that the app is running, and do not wait the login.
Any idea?
How to put timeout=0?
Thanks so much @bthieurmel. This solution worked for me. Do you know if it's possible to utilize admin mode with this flexdashboard use?
It does not work properly
Le lun. 4 janv. 2021 à 06:27, zjmarg notifications@github.com a écrit :
Thanks so much @bthieurmel https://github.com/bthieurmel. This solution worked for me. Do you know if it's possible to utilize admin mode with this flexdashboard use?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/datastorm-open/shinymanager/issues/51#issuecomment-753764038, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKH4B4QT6XO3PDBXPTY2JBLSYFGSPANCNFSM4QL7JSWQ .
I see thank you. Is there anyway to make the shiny manager more secure considering that you can "overpass" the user authentication in the developer's console? Alternatively, is there any package or module that could create a secure authentication for a flexdashboard?
I search for a long time, i did not found it. Other way is to work with shinydashboard...
Le lun. 4 janv. 2021 à 18:26, zjmarg notifications@github.com a écrit :
I see thank you. Is there anyway to make the shiny manager more secure considering that you can "overpass" the user authentication in the developer's console? Alternatively, is there any package or module that could create a secure authentication for a flexdashboard?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/datastorm-open/shinymanager/issues/51#issuecomment-754107057, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKH4B4WSTBUAEHF5XMP35MDSYH25FANCNFSM4QL7JSWQ .
Not a problem, I have been hesitant to do a shinydashboard because I am a novice, but it seems like it's the route I need to go with ultimately. Thanks so much for doing that research and for the help.
thanks no pb. I had the same pb, i move to shiny dashboard...
Le mar. 5 janv. 2021 à 20:07, zjmarg notifications@github.com a écrit :
Not a problem, I have been hesitant to do a shinydashboard because I am a novice, but it seems like it's the route I need to go with ultimately. Thanks so much for doing that research and for the help.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/datastorm-open/shinymanager/issues/51#issuecomment-754837702, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKH4B4VT7NDEGMR3BHYIVTLSYNPPRANCNFSM4QL7JSWQ .
Hi!
Is it possible to use shinymanager with flexdashboard? If so, could I have an example?
Thanks a lot for the cooperation