Learn R Programming

gargle (version 1.2.1)

gargle2.0_token: Generate a gargle token

Description

Constructor function for objects of class Gargle2.0.

Usage

gargle2.0_token(
  email = gargle_oauth_email(),
  app = gargle_app(),
  package = "gargle",
  scope = NULL,
  user_params = NULL,
  type = NULL,
  use_oob = gargle_oob_default(),
  credentials = NULL,
  cache = if (is.null(credentials)) gargle_oauth_cache() else FALSE,
  ...
)

Value

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

Arguments

email

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. "*@example.com", to create code that "just works" for both alice@example.com and bob@example.com. Defaults to the option named "gargle_oauth_email", retrieved by gargle_oauth_email().

app

An OAuth consumer application, created by httr::oauth_app().

package

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

scope

A character vector of scopes to request.

user_params

Named list holding endpoint specific parameters to pass to the server when posting the request for obtaining or refreshing the access token.

type

content type used to override incorrect server response

use_oob

Whether to prefer "out of band" authentication. Defaults to the option named "gargle_oob_default", retrieved via gargle_oob_default().

credentials

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

cache

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.

Examples

Run this code
if (FALSE) {
gargle2.0_token()
}

Run the code above in your browser using DataLab