Learn R Programming

googleAuthR (version 0.5.1)

googleAuthR: googleAuthR: Easy Authentication with Google OAuth2 APIs

Description

Get a startup guide by viewing the vignette: vignette("googleAuthR")

Arguments

Batching

If you have many API calls, you can save a lot of time by using batching. This takes your many calls and sends them in one POST request to www.googleapis.com/batch, returning a list of any responses. See gar_batch for details.

Another common batch task is to call the same function with one parameter changing each call. This is supported using the gar_batch_walk function.

Shiny functions

If you need Shiny authentication, then these functions work together to give a smooth authentication flow.

Default options

These are the default options that you can override via options()

  • googleAuthR.rawResponse = FALSE

  • googleAuthR.httr_oauth_cache = TRUE

  • googleAuthR.verbose = 3

  • googleAuthR.client_id = "201908948134-rm1ij8ursrfcbkv9koc0aqver84b04r7.apps.googleusercontent.com"

  • googleAuthR.client_secret = "nksRJZ5K3nm9FUWsAtBoBArz"

  • googleAuthR.webapp.client_id = "201908948134-cjjs89cffh3k429vi7943ftpk3jg36ed.apps.googleusercontent.com"

  • googleAuthR.webapp.client_secret = "mE7rHl0-iNtzyI1MQia-mg1o"

  • googleAuthR.webapp.port = 1221

  • googleAuthR.jsonlite.simplifyVector = TRUE

  • googleAuthR.scopes.selected = c("https://www.googleapis.com/auth/webmasters", "https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/analytics.readonly", "https://www.googleapis.com/auth/analytics.manage.users.readonly", "https://www.googleapis.com/auth/tagmanager.readonly", "https://www.googleapis.com/auth/urlshortener")

  • googleAuthR.ok_content_types=c("application/json; charset=UTF-8", ("text/html; charset=UTF-8"))

  • googleAuthR.securitycode = paste0(sample(c(1:9, LETTERS, letters), 20, replace = T), collapse='')

  • googleAuthR.tryAttempts = 5

Details

There are two main functions in the googleAuthR package:

  • gar_auth provides local authentication token.

  • gar_api_generator A function factory for easy enabling of Google API functions.