google: Support scopes for ComputeTokenSource
Scopes have been added as a query parameter to the metadata server. Change-Id: Ife68db01beeca386e558edd424fa11da508b7287 GitHub-Last-Rev: 1cb4a6ec12f2b17f6a2290a524b18d60246d56ae GitHub-Pull-Request: golang/oauth2#376 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/170106 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
c85d3e98c9
commit
9f3314589c
@@ -126,7 +126,9 @@ func ExampleComputeTokenSource() {
|
||||
// Fetch from Google Compute Engine's metadata server to retrieve
|
||||
// an access token for the provided account.
|
||||
// If no account is specified, "default" is used.
|
||||
Source: google.ComputeTokenSource(""),
|
||||
// If no scopes are specified, a set of default scopes
|
||||
// are automatically granted.
|
||||
Source: google.ComputeTokenSource("", "https://www.googleapis.com/auth/bigquery"),
|
||||
},
|
||||
}
|
||||
client.Get("...")
|
||||
|
||||
Reference in New Issue
Block a user