| FirebaseOauthProviders {firebase} | R Documentation |
OAuth Providers
Description
Use OAuth provides such as Github or Facebook to allow users to conveniently sign in.
Value
An object of class FirebaseOauthProviders.
Super classes
firebase::Firebase -> firebase::FirebaseAuth -> FirebaseOauthProviders
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
FirebaseOauthProviders$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 Email Link
Initialises the Firebase application client-side.
Method set_provider()
Usage
FirebaseOauthProviders$set_provider(provider, ...)
Arguments
providerThe provider to user, e.g.:
microsoft.com,yahoo.comorgoogle.com....Additional options to pass to setCustomParameters.
Details
Define provider to use
Returns
self
Method launch()
Usage
FirebaseOauthProviders$launch(
flow = c("popup", "redirect"),
get_credentials = FALSE
)Arguments
flowAuthentication flow, either popup or redirect.
get_credentialsWhether to extract underlying oauth credentials.
Details
Launch sign in with Google.
Returns
self
Method clone()
The objects of this class are cloneable with this method.
Usage
FirebaseOauthProviders$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
library(shiny)
library(firebase)
ui <- fluidPage(
useFirebase(),
actionButton("signin", "Sign in with Microsoft", icon = icon("microsoft")),
plotOutput("plot")
)
server <- function(input, output, session){
f <- FirebaseOauthProviders$
new()$
set_provider("microsoft.com")
observeEvent(input$signin, {
f$launch()
})
output$plot <- renderPlot({
f$req_sign_in()
plot(cars)
})
}
## Not run: shinyApp(ui, server)