polished_config: global configuration for 'polished' authentication

View source: R/polished_config.R

polished_configR Documentation

global configuration for polished authentication

Description

global configuration for polished authentication

Usage

polished_config(
  app_name,
  api_key = get_api_key(),
  firebase_config = NULL,
  is_invite_required = TRUE,
  sign_in_providers = "email",
  is_email_verification_required = TRUE,
  cookie_expires = 365L,
  is_auth_required = TRUE,
  is_two_fa_required = FALSE
)

global_sessions_config(...)

Arguments

app_name

the name of the Shiny app.

api_key

the polished API key, available at https://dashboard.polished.tech.

firebase_config

if using Social Sign In (see https://polished.tech/docs/03-social-sign-in for more documentation), a list containing your Firebase project configuration (Default: NULL). This list should have the following named elements:

  • apiKey

  • authDomain

  • projectId

is_invite_required

TRUE by default. Whether or not to require the user to have an invite before registering/signing in

sign_in_providers

a character vector of sign in providers to enable. Valid values are "google" "email", "microsoft", and/or "facebook". Defaults to "email".

is_email_verification_required

TRUE by default. Whether or not to require the user to verify their email before accessing your Shiny app.

cookie_expires

the number of days before a user's cookie expires. Set to NULL to force Sign Out at session end. This argument is passed to the expires option in js-cookie: https://github.com/js-cookie/js-cookie#expires. Default value is 365L (i.e. 1 year)

is_auth_required

TRUE by default. Whether or not to require users to be signed in to access the app. It can be useful to set this argument to FALSE if you want to allow users to do certain actions (such as viewing charts and tables) without signing in, and only require users to sign in if they want to save data to your database.

is_two_fa_required

boolean specifying whether or not 2 factor authentication is required. Defaults to FALSE.

...

arguments to pass to polished_config

Details

This is the primary function for configuring polished. It configures your app's instance of the Polished class that manages polished authentication. Call this function in your global.R file. See https://github.com/Tychobra/polished/blob/master/inst/examples/polished_example_01/global.R for a complete example.

Value

invisible(NULL)

Examples


## Not run: 
# global.R

polished_config(
  app_name = "<your app name>",
  api_key = "<your API key>",
  firebase_config = list(
    apiKey = "<Firebase apiKey>",
    authDomain = "<Firebase authDomain",
    projectId = "<Firebase projectId>"
  ),
  sign_in_providers = c(
    "email",
    "google",
    "microsoft"
  )
)


## End(Not run)


polished documentation built on Feb. 16, 2023, 8:02 p.m.