-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DwD example for "header" and "curl" option. (#144)
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,6 +145,13 @@ example, the following command uses the PubSub API to list all PubSub topics. | |
$ curl -H "$(oauth2l header --scope pubsub)" https://pubsub.googleapis.com/v1/projects/my-project-id/topics | ||
``` | ||
|
||
To send an API request using domain-wide delegation (DwD), for example, to | ||
list `[email protected]`'s Gmail labels: | ||
|
||
```bash | ||
$ curl -H "$(oauth2l header --email [email protected] --credentials service_account_credentials.json --scope https://www.googleapis.com/auth/gmail.labels)" https://gmail.googleapis.com/gmail/v1/users/me/labels | ||
``` | ||
|
||
### curl | ||
|
||
This is a shortcut command that fetches an access token for the specified OAuth | ||
|
@@ -155,6 +162,14 @@ default). Additional flags after "--" will be treated as curl flags. | |
$ oauth2l curl --scope cloud-platform,pubsub --url https://pubsub.googleapis.com/v1/projects/my-project-id/topics -- -i | ||
``` | ||
|
||
To send an API request using domain-wide delegation (DwD), for example, to | ||
list `[email protected]`'s Gmail labels: | ||
|
||
```bash | ||
$ oauth2l curl --email [email protected] --credentials service_account_credentials.json --scope https://www.googleapis.com/auth/gmail.labels --url https://gmail.googleapis.com/gmail/v1/users/me/labels | ||
``` | ||
|
||
|
||
### info | ||
|
||
Print information about a valid token. This always includes the list of scopes | ||
|