oauth2: fixes tokenRefresher.Token() ignores new refresh_token

Fixes bug documented in Issue #84 (https://github.com/golang/oauth2/issues/84#issuecomment-72711375).

During a refresh request, a new refresh token MAY be returned by the authorization server.  When this occurs, tokenRefesher.Token() fails to capture the new refresh token leaving it with an invalid refresh token for future calls.

Change-Id: I33b18fdbb750549174865f75eddf85b9725cf281
Reviewed-on: https://go-review.googlesource.com/4151
Reviewed-by: Andrew Gerrand <adg@golang.org>
2 files changed
tree: 7be57a1de0fd6c64a4f0e028a14f120f6f428760
  1. github/
  2. google/
  3. internal/
  4. jws/
  5. jwt/
  6. .travis.yml
  7. AUTHORS
  8. client_appengine.go
  9. CONTRIBUTING.md
  10. CONTRIBUTORS
  11. example_test.go
  12. LICENSE
  13. oauth2.go
  14. oauth2_test.go
  15. README.md
  16. token.go
  17. token_test.go
  18. transport.go
  19. transport_test.go
README.md

OAuth2 for Go

Build Status

oauth2 package contains a client implementation for OAuth 2.0 spec.

Installation

go get golang.org/x/oauth2

See godoc for further documentation and examples.