forked from remote/oauth2
google: implement application default credentials
Google is moving toward a default, language-agnostic way of obtaining authentication credentials on App Engine and Compute Engine. This change implements this mechanism. Fixes #90. Change-Id: Iaae4d60bbc75b1a9f2ec6ad14ab76fb2e279d756 Reviewed-on: https://go-review.googlesource.com/6074 Reviewed-by: Burcu Dogan <jbd@google.com>
This commit is contained in:
@@ -19,6 +19,15 @@ import (
|
||||
"google.golang.org/appengine/urlfetch"
|
||||
)
|
||||
|
||||
func ExampleDefaultClient() {
|
||||
client, err := google.DefaultClient(oauth2.NoContext,
|
||||
"https://www.googleapis.com/auth/devstorage.full_control")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
client.Get("...")
|
||||
}
|
||||
|
||||
func Example_webServer() {
|
||||
// Your credentials should be obtained from the Google
|
||||
// Developer Console (https://console.developers.google.com).
|
||||
|
||||
Reference in New Issue
Block a user