Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dejan94it/shinyOTP
R package that provides Shiny modules to easily implement One-Time Password (OTP) authentication in your Shiny applications.
https://github.com/dejan94it/shinyOTP
package r shiny shiny-apps shinyapps
Last synced: 2 months ago
JSON representation
R package that provides Shiny modules to easily implement One-Time Password (OTP) authentication in your Shiny applications.
- Host: GitHub
- URL: https://github.com/dejan94it/shinyOTP
- Owner: dejan94it
- Created: 2024-10-18T16:39:47.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-22T08:43:48.000Z (3 months ago)
- Last Synced: 2024-10-22T13:32:38.576Z (3 months ago)
- Topics: package, r, shiny, shiny-apps, shinyapps
- Language: R
- Homepage:
- Size: 724 KB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - dejan94it/shinyOTP - R package that provides Shiny modules to easily implement One-Time Password (OTP) authentication in your Shiny applications. (R)
README
# shinyOTP
`shinyOTP` is an R package that provides Shiny modules to easily implement
One-Time Password (OTP) authentication in your Shiny applications.## Installation
At the moment you can install only this version from GitHub:```r
# Install devtools if necessary
# install.packages("devtools")devtools::install_github("dejan94it/shinyOTP")
```## Usage
Set email and password from which you want to send OTP code as environmental
variable, and then just use ui and server functions.Here is a minimal Shiny App:
```r
library(shiny)
library(shinyOTP)Sys.setenv(SMTP_EMAIL = "youremail")
Sys.setenv(SMTP_PASSWORD = "yourpassword")ui <- fluidPage(
fluidRow(otp_ui("otp_module")),
fluidRow(htmlOutput("do_something"))
)server <- function(input, output, session) {
is_verified <- otp_server(
"otp_module",
smtp_email = "SMTP_EMAIL",
smtp_password = "SMTP_PASSWORD",
smtp_host = "yoursmtphost", #example: smtp.gmail.com
smtp_port = 465, #search the port number of your smtp host
ssl = TRUE, #paired with host and port usually
)
output$do_something <- renderUI({
if(is_verified()){
return(h2("Do something when verified!"))
} else {
return(NULL)
}
})
}shinyApp(ui, server)
```