This function gives advanced users more control over auth.
Whereas drive_auth()
gives control over tokens, drive_auth_config()
gives control of:
The googledrive auth state. The default is active, meaning all requests
are sent with a token and, if one is not already loaded, OAuth flow is
initiated. It is possible, however, to place unauthorized requests to
the Drive API, as long as you are accessing public resources. Set active
to FALSE
to enter this state and never send a token.
The OAuth app. If you want to use your own app, setup a new project in
Google Developers Console. Follow
the instructions in
OAuth 2.0 for Mobile & Desktop Apps
to obtain your own client ID and secret. Provide these to
httr::oauth_app()
.
The API key. If googledrive auth is deactivated (see above), all requests will be sent with an API key. If you want to provide your own, setup a project as described above and follow the instructions in Setting up API keys.
drive_auth_config(active = TRUE, app = NULL, api_key = NULL,
verbose = TRUE)
Logical. TRUE
means a token will be sent. FALSE
means it
will not.
OAuth app. Defaults to a tidyverse app that ships with googledrive.
API key. Defaults to a key that ships with googledrive. Necessary in order to make unauthorized "token-free" requests for public resources.
Logical, indicating whether to print informative messages
(default TRUE
).
A list of class auth_config
, with the current auth configuration.
Other auth functions: drive_auth
,
drive_deauth
# NOT RUN {
drive_auth_config()
# }
Run the code above in your browser using DataLab