From a6352401a13fd6943ec46fcb28cf6b912659ec0e Mon Sep 17 00:00:00 2001 From: Liron Newman Date: Sun, 20 Nov 2022 18:00:52 +0000 Subject: [PATCH 1/2] Add DwD example for the "header" option. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2bff387..847d060 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,12 @@ 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 `user@example.com`'s Gmail labels: + +```bash +$ curl -H "$(oauth2l header --email user@example.com --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 From 708d317a15c6e4e3f3084b944b041fcc69dfa2db Mon Sep 17 00:00:00 2001 From: Liron Newman Date: Mon, 21 Nov 2022 19:52:11 +0000 Subject: [PATCH 2/2] Add DwD example for "oauth2l curl". --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 847d060..94527a8 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ list `user@example.com`'s Gmail labels: ```bash $ curl -H "$(oauth2l header --email user@example.com --credentials service_account_credentials.json --scope https://www.googleapis.com/auth/gmail.labels)" https://gmail.googleapis.com/gmail/v1/users/me/labels +``` ### curl @@ -161,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 `user@example.com`'s Gmail labels: + +```bash +$ oauth2l curl --email user@example.com --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