Fetch a token for the given scopes
This is a rather magical function that calls a series of concrete
credential-fetching functions, each wrapped in a tryCatch()
.
token_fetch()
keeps trying until it succeeds or there are no more functions
to try. Use cred_funs_list()
to see the current registry, in order. See the
vignette How gargle gets tokens for a
full description of token_fetch()
.
token_fetch(scopes = NULL, ...)
scopes |
A character vector of scopes to request. Pick from those listed at https://developers.google.com/identity/protocols/oauth2/scopes. For certain token flows, the
|
... |
Additional arguments passed to all credential functions. |
An httr::Token
or NULL
.
Other credential functions:
credentials_app_default()
,
credentials_byo_oauth2()
,
credentials_gce()
,
credentials_service_account()
,
credentials_user_oauth2()
## Not run: token_fetch(scopes = "https://www.googleapis.com/auth/userinfo.email") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.