FirebaseUI | R Documentation |
Use firebase to manage authentications.
An object of class FirebaseUI
.
firebase::Firebase
-> firebase::FirebaseAuth
-> FirebaseUI
tos_url
URL to the Terms of Service page.
privacy_policy_url
The URL to the Privacy Policy page.
firebase::Firebase$expose_app()
firebase::FirebaseAuth$clear()
firebase::FirebaseAuth$delete_user()
firebase::FirebaseAuth$expose_auth()
firebase::FirebaseAuth$get_access_token()
firebase::FirebaseAuth$get_delete_user()
firebase::FirebaseAuth$get_id_token()
firebase::FirebaseAuth$get_sign_out()
firebase::FirebaseAuth$get_signed_in()
firebase::FirebaseAuth$get_signed_up()
firebase::FirebaseAuth$is_signed_in()
firebase::FirebaseAuth$print()
firebase::FirebaseAuth$req_sign_in()
firebase::FirebaseAuth$req_sign_out()
firebase::FirebaseAuth$request_id_token()
firebase::FirebaseAuth$set_language_code()
firebase::FirebaseAuth$sign_out()
new()
FirebaseUI$new( persistence = c("session", "local", "memory"), config_path = "firebase.rds", language_code = NULL, session = shiny::getDefaultReactiveDomain() )
persistence
How the auth should persit: none
, the user has to sign in at every visit,
session
will only persist in current tab, local
persist even when window is closed.
config_path
Path to the configuration file as created by firebase_config
.
language_code
Sets the language to use for the UI.
Supported languages are listed here.
Set to browser
to use the default browser language of the user.
session
A valid shiny session.
Initialiases Firebase UI
Initialises the Firebase application client-side.
set_providers()
FirebaseUI$set_providers( google = FALSE, facebook = FALSE, twitter = FALSE, github = FALSE, email = FALSE, email_link = FALSE, microsoft = FALSE, apple = FALSE, yahoo = FALSE, phone = FALSE, anonymous = FALSE )
google, facebook, twitter, github, email, email_link, microsoft, apple, yahoo, phone, anonymous
Set to TRUE
the providers you want to use, at least one.
Define signin and login providers.
self
set_tos_url()
FirebaseUI$set_tos_url(url)
url
URL to use.
Defines Tterms of Services URL
self
set_privacy_policy_url()
FirebaseUI$set_privacy_policy_url(url)
url
URL to use.
Defines Privacy Policy URL
self
launch()
FirebaseUI$launch(flow = c("popup", "redirect"), account_helper = FALSE)
flow
The signin flow to use, popup or redirect.
account_helper
Wether to use accountchooser.com upon signing in or signing up with email, the user will be redirected to the accountchooser.com website and will be able to select one of their saved accounts. You can disable it by specifying the value below.
...
Any other option to pass to Firebase UI.
Setup the signin form.
self
reset_password()
FirebaseUI$reset_password(email = NULL)
email
Email to send reset link to, if missing looks for current logged in user's email
Reset user password
self
get_reset()
FirebaseUI$get_reset()
Get whether password reset email was successfully sent
A list of length 2 containing success
a boolean
indicating whether email reset was successful and response
containing successful
or the error.
send_verification_email()
FirebaseUI$send_verification_email()
Send the user a verification email
self
get_verification_email()
FirebaseUI$get_verification_email()
Get result of verification email sending procedure
A list of length 2 containing success
a boolean
indicating whether email verification was successfully sent and response
containing successful
or the error.
set_password()
FirebaseUI$set_password(password)
password
The authenticated user password, the user should be prompted to enter it.
Set user password
Useful to provide ability to change password.
self
get_password()
FirebaseUI$get_password()
Get response from set_password
A list of length 2 containing success
a boolean
indicating whether setting password was successfully set and response
containing successful
as string or the error.
re_authenticate()
FirebaseUI$re_authenticate(password)
password
The authenticated user password, the user should be prompted to enter it.
Re-authenticate the user.
Some security-sensitive actions—such as deleting an account, setting a primary email address, and changing a password—require that the user has recently signed in. If you perform one of these actions, and the user signed in too long ago, the action fails with an error.
get_re_authenticated()
FirebaseUI$get_re_authenticated()
Get response from re_authenticate
A list of length 2 containing success
a boolean
indicating whether re-authentication was successful and response
containing successful
as string or the error.
clone()
The objects of this class are cloneable with this method.
FirebaseUI$clone(deep = FALSE)
deep
Whether to make a deep clone.
library(shiny)
library(firebase)
ui <- fluidPage(
useFirebase(), # import dependencies
firebaseUIContainer() # import UI
)
server <- function(input, output){
f <- FirebaseUI$
new()$ # instantiate
set_providers( # define providers
email = TRUE,
google = TRUE
)
}
## Not run: shinyApp(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.