Add service account example

This commit is contained in:
Heng Xiong 2017-07-13 14:58:23 -07:00
parent 403debaaa2
commit 608e9f9b91
1 changed files with 12 additions and 0 deletions

View File

@ -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