Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gar_gce_auth

Authenticate on Google Compute Engine


Description

This takes the metadata auth token in a Google Compute Engine instance as authentication source

Usage

gar_gce_auth(
  service_account = "default",
  scopes = "https://www.googleapis.com/auth/cloud-platform"
)

Arguments

service_account

Specify a different service account from the default

scopes

Scopes for the authentication

Details

service_account is default or the service account email e.g. "service-account-key-json@projectname.iam.gserviceaccount.com"

Google Compute Engine instances come with their own authentication tokens.

It has no refresh token so you need to call for a fresh token after approx. one hour. The metadata token will refresh itself when it has about 60 seconds left.

You can only use for scopes specified when creating the instance.

If you want to use them make sure their service account email is added to accounts you want to get data from.

Value

A token

See Also


googleAuthR

Authenticate and Create Google APIs

v1.4.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>), Jennifer Bryan [ctb], Johann deBoer [ctb], Neal Richardson [ctb], David Kulp [ctb], Joe Cheng [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.