Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Google Sign In API for websites #119

Closed
MarkEdmondson1234 opened this issue May 15, 2018 · 2 comments
Closed

Support Google Sign In API for websites #119

MarkEdmondson1234 opened this issue May 15, 2018 · 2 comments

Comments

@MarkEdmondson1234
Copy link
Owner

This looks like a more modern and alternative way than JS auth

https://developers.google.com/identity/sign-in/web/sign-in

Lets users stay signed in etc. See demo app here
https://github.com/dkulp2/Google-Sign-In

@MarkEdmondson1234
Copy link
Owner Author

@MarkEdmondson1234
Copy link
Owner Author

MarkEdmondson1234 commented Nov 11, 2018

This is adapted from @dkulp2's app, turned into a Shiny module. To replicate the app:

library(shiny)
library(googleAuthR)

options(googleAuthR.webapp.client_id = "1080525199262-qecndq7frddi66vr35brgckc1md5rgcl.apps.googleusercontent.com")

ui <- fluidPage(
    
    titlePanel("Sample Google Sign-In"),
    
    sidebarLayout(
      sidebarPanel(
        googleSignInUI("demo")
      ),
      
      mainPanel(
        with(tags, dl(dt("Name"), dd(textOutput("g_name")),
                      dt("Email"), dd(textOutput("g_email")),
                      dt("Image"), dd(uiOutput("g_image")) ))
      )
    )
  )

server <- function(input, output, session) {
  
  sign_ins <- callModule(googleSignIn, "demo")
  
  output$g_name = renderText({ sign_ins()$name })
  output$g_email = renderText({ sign_ins()$email })
  output$g_image = renderUI({ img(src=sign_ins()$image) })
  
}

# Run the application 
shinyApp(ui = ui, server = server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant