These functions can be used in a ui.R/server.R framework, modifying the shiny objects to authenticate using Auth0 service with no pain.

auth0_ui(ui, info)

auth0_server(server, info)

Arguments

ui

shiny.tag.list object to generate the user interface.

info

object returned from auth0_info. If not informed, will try to find the _auth0.yml and create it automatically.

server

the shiny server function.

See also

Examples

# \donttest{ # first, create the yml file using use_auth0() function # ui.R file library(shiny) library(auth0) auth0_ui(fluidPage(logoutButton()))
#> Error in auth0_find_config_file(): Didn't find any YML configuration file. There are two possible explanations: #> 1. You didn't create an _auth0.yml file. Solution: Run `use_auth0()` #> 2. You created an _auth0.yml file, but it was not found. #> You have two options: #> Solution 2a): set the path for the _auth0.yml file running `options(auth0_config_file = "/path/to/_auth0.yml")`. Always use absolute path, because shiny::runApp() modifies the working directory. #> Solution 2b): If your app.R file is in the same directory as the _auth0.yml file, set the working directory to the folder where _auth0.yml file is located.
# server.R file library(auth0) auth0_server(function(input, output, session) {})
#> Error in auth0_find_config_file(): Didn't find any YML configuration file. There are two possible explanations: #> 1. You didn't create an _auth0.yml file. Solution: Run `use_auth0()` #> 2. You created an _auth0.yml file, but it was not found. #> You have two options: #> Solution 2a): set the path for the _auth0.yml file running `options(auth0_config_file = "/path/to/_auth0.yml")`. Always use absolute path, because shiny::runApp() modifies the working directory. #> Solution 2b): If your app.R file is in the same directory as the _auth0.yml file, set the working directory to the folder where _auth0.yml file is located.
# console options(shiny.port = 8080) shiny::runApp()
#> Error in shinyAppDir(x): App dir must contain either app.R or server.R.
# }