Checks whether the user can obtain an access token for Google Cloud Services (GCS) using a service account key stored on file.

dai_auth(
  path = Sys.getenv("GCS_AUTH_FILE"),
  scopes = "https://www.googleapis.com/auth/cloud-platform"
)

Arguments

path

path to a JSON file with a service account key

scopes

GCS auth scopes for the token

Value

no return value, called for side effects

Details

daiR takes a very parsimonious approach to authentication, with the native auth functions only supporting service account files. Those who prefer other authentication methods can pass those directly to the token parameter in the various functions that call the Document AI API.

Examples

if (FALSE) {
dai_auth()
}