Skip to content

Constructor function for objects of class Gargle2.0.


  email = gargle_oauth_email(),
  app = gargle_client(),
  package = "gargle",
  scope = NULL,
  use_oob = gargle_oob_default(),
  credentials = NULL,
  cache = if (is.null(credentials)) gargle_oauth_cache() else FALSE,



Optional. Allows user to target a specific Google identity. If specified, this is used for token lookup, i.e. to determine if a suitable token is already available in the cache. If no such token is found, email is used to pre-select the targetted Google identity in the OAuth chooser. Note, however, that the email associated with a token when it's cached is always determined from the token itself, never from this argument. Use NA or FALSE to match nothing and force the OAuth dance in the browser. Use TRUE to allow email auto-discovery, if exactly one matching token is found in the cache. Specify just the domain with a glob pattern, e.g. "*", to create code that "just works" for both and Defaults to the option named "gargle_oauth_email", retrieved by gargle_oauth_email().


A Google OAuth client, preferably constructed via gargle_oauth_client_from_json(), which returns an instance of gargle_oauth_client. For backwards compatibility, for a limited time, gargle will still accept an "OAuth app" created with httr::oauth_app().


Name of the package requesting a token. Used in messages.


A character vector of scopes to request.


Whether to prefer out-of-band authentication. Defaults to the value returned by gargle_oob_default().


Advanced use only: allows you to completely customise token generation.


Specifies the OAuth token cache. Defaults to the option named "gargle_oauth_cache", retrieved via gargle_oauth_cache().


Absorbs arguments intended for use by other credential functions. Not used.


An object of class Gargle2.0, either new or loaded from the cache.


if (FALSE) {