oauth2: add func NewClient as per issue #66

Change-Id: Icfae8530e725f2f31774e395319e6e6db330262a
Reviewed-on: https://go-review.googlesource.com/1701
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Dave Day
2014-12-17 10:39:29 +11:00
parent 79dad4e0f4
commit 7bbf2199a5
2 changed files with 13 additions and 12 deletions

7
jwt.go
View File

@@ -74,12 +74,7 @@ func (c *JWTConfig) TokenSource(ctx Context, initialToken *Token) TokenSource {
//
// The returned client and its Transport should not be modified.
func (c *JWTConfig) Client(ctx Context, initialToken *Token) *http.Client {
return &http.Client{
Transport: &Transport{
Base: contextTransport(ctx),
Source: c.TokenSource(ctx, initialToken),
},
}
return NewClient(ctx, c.TokenSource(ctx, initialToken))
}
// jwtSource is a source that always does a signed JWT request for a token.