From 608e9f9b91e6233b421338a2aa889b26e3cb7830 Mon Sep 17 00:00:00 2001 From: Heng Xiong Date: Thu, 13 Jul 2017 14:58:23 -0700 Subject: [PATCH] Add service account example --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 7e21213..8cdb255 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,18 @@ end # OK to use credentials ``` +### Example (Service Account) + +```ruby +scope = 'https://www.googleapis.com/auth/androidpublisher' + +authorizer = Google::Auth::ServiceAccountCredentials.make_creds( + json_key_io: File.open('/path/to/service_account_json_key.json'), + scope: scope) + +authorizer.fetch_access_token! +``` + ### Storage Authorizers require a storage instance to manage long term persistence of