Learn R Programming

firebase (version 0.1.0)

FirebaseOauthProviders: OAuth Providers

Description

Use OAuth provides such as Github or Facebook to allow users to conveniently sign in.

Arguments

Super class

firebase::Firebase -> FirebaseOauthProviders

Methods

Public methods

Method set_provider()

Usage

FirebaseOauthProviders$set_provider(provider)

Arguments

provider

The provider to user, e.g.: microsoft.com, yahoo.com or google.com.

Details

Define provider to use

Returns

self

Method launch()

Usage

FirebaseOauthProviders$launch(flow = c("popup", "redirect"))

Arguments

flow

Authentication flow, either popup or redirect.

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

deep

Whether to make a deep clone.

Examples

Run this code
# NOT RUN {
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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab