| FirebaseSocial {firebase} | R Documentation |
Social
Description
Use social sites for authentication.
Value
An object of class FirebaseSocial.
Super classes
firebase::Firebase -> firebase::FirebaseAuth -> FirebaseSocial
Methods
Public methods
Inherited methods
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()
Method new()
Usage
FirebaseSocial$new(
persistence = c("session", "local", "memory"),
config_path = "firebase.rds",
language_code = NULL,
session = shiny::getDefaultReactiveDomain()
)Arguments
persistenceHow the auth should persit:
none, the user has to sign in at every visit,sessionwill only persist in current tab,localpersist even when window is closed.config_pathPath to the configuration file as created by
firebase_config.language_codeSets the language to use for the UI. Supported languages are listed here. Set to
browserto use the default browser language of the user.sessionA valid shiny session.
Details
Initialiases Firebase Social
Initialises the Firebase application client-side.
Method set_scope()
Usage
FirebaseSocial$set_scope(scope)
Arguments
scopeGoogle scope.
Details
Define the scope to request from Google.
Returns
self
Method launch_google()
Usage
FirebaseSocial$launch_google(flow = c("popup", "redirect"))Arguments
flowAuthentication flow, either popup or redirect.
Details
Launch sign in with Google.
Returns
self
Method launch_github()
Usage
FirebaseSocial$launch_github(flow = c("popup", "redirect"))Arguments
flowAuthentication flow, either popup or redirect.
Details
Launch sign in with Github.
Returns
self
Method launch_facebook()
Usage
FirebaseSocial$launch_facebook(flow = c("popup", "redirect"))Arguments
flowAuthentication flow, either popup or redirect.
Details
Launch sign in with Facebook.
Returns
self
Method launch_twitter()
Usage
FirebaseSocial$launch_twitter(flow = c("popup", "redirect"))Arguments
flowAuthentication flow, either popup or redirect.
Details
Launch sign in with Facebook.
Returns
self
Method clone()
The objects of this class are cloneable with this method.
Usage
FirebaseSocial$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
library(shiny)
library(firebase)
# define signin
signin <- modalDialog(
title = "Login",
actionButton("google", "Google", icon = icon("google"), class = "btn-danger"),
actionButton("github", "Github", icon = icon("github")),
footer = NULL
)
ui <- fluidPage(
useFirebase()
)
server <- function(input, output) {
showModal(signin)
f <- FirebaseSocial$new()
observeEvent(input$google, {
f$launch_google()
})
observeEvent(input$github, {
f$launch_github()
})
}
## Not run: shinyApp(ui, server)