gar_gce_auth: Authenticate on Google Compute Engine

Description Usage Arguments Details Value See Also

View source: R/googleAuthR_gce.R

Description

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

Usage

1
2
3
gar_gce_auth(service_account = "default",
  client.id = getOption("googleAuthR.webapp.client_id"),
  client.secret = getOption("googleAuthR.webapp.client_secret"))

Arguments

service_account

Specify a different service account from the default

client.id

From the Google API console.

client.secret

From the Google API console.

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.

If this function is called on a non-Google Compute Engine instance it will return NULL

Value

A token

See Also

gar_gce_auth_email

Other authentication functions: gar_attach_auto_auth, gar_auth_service, gar_auth, gar_auto_auth, get_google_token, is_legit_token, token_exists


yinscapital/googleAuthR-reference documentation built on May 3, 2019, 4:31 p.m.