Merge pull request #110 from hxiong388/update-readme
Add service account example
This commit is contained in:
commit
0f7fe1ea91
12
README.md
12
README.md
|
@ -131,6 +131,18 @@ end
|
||||||
# OK to use credentials
|
# 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
|
### Storage
|
||||||
|
|
||||||
Authorizers require a storage instance to manage long term persistence of
|
Authorizers require a storage instance to manage long term persistence of
|
||||||
|
|
Loading…
Reference in New Issue