# NOT RUN {
library(googleAuthR)
## change the native googleAuthR scopes to the one needed.
options("googleAuthR.scopes.selected" = "email")
get_email <- function(){
f <- gar_api_generator("https://openidconnect.googleapis.com/v1/userinfo",
"POST",
data_parse_function = function(x) x$email,
checkTrailingSlash = FALSE)
f()
}
To use the above functions:
library(googleAuthR)
# go through authentication flow
gar_auth()
s <- get_email()
s
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab