gauthenticator 0.2.1

Simple API for authenticating with google services Project homepage: https://github.com/isaacadams/bq-rs
Documentation

Usage

Load Service Account

There are two ways to instantiate a service account.

  1. Point to a file
let service_account = gauthenticator::ServiceAccountKey::from_file("./path-to/service-account-key.json").unwrap();
  1. Using the GOOGLE_APPLICATION_CREDENTIALS environment variable
let service_account = gauthenticator::ServiceAccountKey::from_env().unwrap();

Get Access Token

let service_account = gauthenticator::ServiceAccountKey::from_env().unwrap();
let token = service_account.access_token(None)?;