Uses the metadata service available on GCE VMs to fetch an access token.
credentials_gce(
scopes = "https://www.googleapis.com/auth/cloud-platform",
service_account = "default",
...
)
A GceToken()
or NULL
.
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
"https://www.googleapis.com/auth/userinfo.email"
scope is unconditionally
included. This grants permission to retrieve the email address associated
with a token; gargle uses this to index cached OAuth tokens. This grants no
permission to view or send email and is generally considered a low-value
scope.
Name of the GCE service account to use.
Additional arguments passed to all credential functions.
https://cloud.google.com/compute/docs/metadata/overview
Other credential functions:
credentials_app_default()
,
credentials_byo_oauth2()
,
credentials_external_account()
,
credentials_service_account()
,
credentials_user_oauth2()
,
token_fetch()
if (FALSE) {
credentials_gce()
}
Run the code above in your browser using DataLab