Create the Synapse OAuth component of a Shiny app.

If this is the first time signing in, will need to do OAuth the process. The OAuth process will redirect back here and an authorization code should be in the URL parameters. If this code is available, lauch the main app_ui. This function should be called from startup called from the UI function specified when creating the application object (i.e. the function specified in the ui parameter here shinyApp(ui = app_ui, server = app_server)), which receives the request object and can pass it along.

IMPORTANT: this module assumes the following global variables are available and valid: app, api, authorization_url, app_url, claims_params, scope. See setup_global_oauth_vars.

mod_synapse_oauth_ui(id, request, main_ui = mod_main_ui, main_ui_id = "main")

mod_synapse_oauth_server(id, syn)

Arguments

id

The module id.

request

Shiny request object.

main_ui

UI function to redirect to when OAuth is done. Defaults to mod_main_ui.

main_ui_id

The module id to use when launching main_ui. Defaults to "main".

syn

Synapse client object

Examples

if (FALSE) { library("dccvalidator") app_ui <- function(request) { mod_synapse_oauth_ui(id = "oauth", request = request) } app_server <- function(input, output, session) { synapse <- reticulate::import("synapseclient") syn <- synapse$Synapse() syn <- mod_synapse_oauth_server( id = "oauth", syn = syn ) shiny::req(inherits(syn, "synapseclient.client.Synapse"), logged_in(syn)) } run_app() }