Learn R Programming

polished (version 0.8.1)

polished_config: 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(...)

Value

invisible(NULL)

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.

Examples

Run this code

if (FALSE) {
# global.R

polished_config(
  app_name = "",
  api_key = "",
  firebase_config = list(
    apiKey = "",
    authDomain = "

Run the code above in your browser using DataLab