From af451b9e0dbe3347d979fd871535c6e5aa33eb62 Mon Sep 17 00:00:00 2001 From: Andre Claudino Date: Tue, 2 Feb 2021 17:50:09 -0300 Subject: [PATCH] Upate README to include `scopes` parameter and correct default credentials path --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0aad08a..08cf02d 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,9 @@ When running inside GCP the library can be asked without any further configurati provide a bearer token for the current service account of the service. ```rust +let scopes = &["https://www.googleapis.com/auth/bigquery/"]; let authentication_manager = gcp_auth::init().await?; -let token = authentication_manager.get_token().await?; +let token = authentication_manager.get_token(scopes).await?; ``` ## Custom service account @@ -52,15 +53,16 @@ application at run time. The path to the configuration file is specified by the ```rust // With the GOOGLE_APPLICATION_CREDENTIALS environment variable set +let scopes = &["https://www.googleapis.com/auth/bigquery/"]; let authentication_manager = gcp_auth::init().await?; -let token = authentication_manager.get_token().await?; +let token = authentication_manager.get_token(&scopes).await?; ``` ## Local user authentication This authentication method allows developers to authenticate again GCP when developing locally. Its use should be limited to development. Credentials can be -set up using the `gcloud auth` utility. Credentials are read from file `~/.config/gcloud/ication_default_credentials.json`. +set up using the `gcloud auth` utility. Credentials are read from file `~/.config/gcloud/application_default_credentials.json`. ## FAQ