rdfp to access your Google user data. You will be
directed to a web browser, asked to sign in to your Google account, and to
rdfp access to user data for Double Click for Publishers.
These user credentials are cached in a file named
the current working directory, from where they can be automatically refreshed,
dfp_auth(token = NULL, new_user = FALSE, addtl_scopes = c("https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/presentations", "https://www.googleapis.com/auth/analytics", "https://www.googleapis.com/auth/yt-analytics.readonly", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.send"), key = getOption("rdfp.client_id"), secret = getOption("rdfp.client_secret"), cache = getOption("rdfp.httr_oauth_cache"), verbose = TRUE)
an actual token object or the path to a valid token stored as an
logical, defaults to
FALSE. Set to
TRUEif you want to wipe the slate clean and re-authenticate with the same or different Google account. This deletes the
.httr-oauth-rdfpfile in current working directory.
character, strings that indicate additional Google services the client should authorize. Use this when trying to generate a token that will work to authenticate to other packages using Google services, such as the googlesheets package or RGoogleAnalytics package.
- key, secret
the "Client ID" and "Client secret" for the application
logical indicating if
rdfpshould cache credentials in the default cache file
a logical indicating if messages should be printed
Most users, most of the time, do not need to call this function explicitly -- it will be triggered by the first action that requires authorization. Even when called, the default arguments will often suffice. However, when necessary, this function allows the user to
store a token -- the token is invisibly returned and can be assigned to an object or written to an
read the token from an
.rdsfile or pre-existing object in the workspace
provide your own app key and secret -- this requires setting up a new project in Google Developers Console
prevent caching of credentials in
In a call to
dfp_auth, the user can provide the token, app key and
secret explicitly and can dictate whether credentials will be cached in
.httr-oauth-rdfp. They must be specified.
To set options in a more persistent way, predefine one or more of
them with lines like this in a
options(rdfp.network_code = "12345678", rdfp.application_name = "MyApp", rdfp.client_id = "012345678901-99thisisatest99.apps.googleusercontent.com", rdfp.client_secret = "Th1s1sMyC1ientS3cr3t", rdfp.httr_oauth_cache = FALSE)
Startup for possible locations for this file and the
More detail is available from Using OAuth 2.0 to Access Google APIs.
an OAuth token object, specifically a