mirror of
https://github.com/golang/oauth2.git
synced 2025-07-21 00:00:09 +08:00
Creates a new package called clientcredentials and adds transport and token information to the internal package. Also modifies the oauth2 package to make use of the newly added files in the internal package. The clientcredentials package allows for token requests using a "client credentials" grant type. Fixes https://github.com/golang/oauth2/issues/7 Change-Id: Iec649d1029870c27a2d1023baa9d52db42ff45e8 Reviewed-on: https://go-review.googlesource.com/2983 Reviewed-by: Burcu Dogan <jbd@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
26 lines
546 B
Go
26 lines
546 B
Go
// Copyright 2014 The oauth2 Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build appengine appenginevm
|
|
|
|
// App Engine hooks.
|
|
|
|
package oauth2
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"golang.org/x/net/context"
|
|
"golang.org/x/oauth2/internal"
|
|
"google.golang.org/appengine/urlfetch"
|
|
)
|
|
|
|
func init() {
|
|
internal.RegisterContextClientFunc(contextClientAppEngine)
|
|
}
|
|
|
|
func contextClientAppEngine(ctx context.Context) (*http.Client, error) {
|
|
return urlfetch.Client(ctx), nil
|
|
}
|