Skip to contents

Adds shinyOAuth's client-side JavaScript dependency to your Shiny UI. This is required so the module can handle redirects and manage its browser-side session token.

Without this call in the UI, oauth_module_server() will not work.

Usage

use_shinyOAuth(inject_referrer_meta = TRUE)

Arguments

inject_referrer_meta

If TRUE (default), injects a <meta name="referrer" content="no-referrer"> tag into the document head. This reduces the risk of leaking OAuth callback query parameters (like code and state) via the Referer header to third-party subresources during the initial callback page load.

Value

A tagList that loads the inst/www/shinyOAuth.js dependency once.

Details

Place this near the top-level of your UI (e.g., inside fluidPage() or tagList()), similar to how you would use shinyjs::useShinyjs().

Examples

ui <- shiny::fluidPage(
  use_shinyOAuth(),
  # ...
)