stackoverflow: add stackoverflow oauth2 endpoints.

Fixes #297

Stackoverflow oauth2 endpoints constant added.

Change-Id: I8285a9baa9514c79e8325c40434f62aa1ed4939b
GitHub-Last-Rev: 909997b81e544c02130cc08f5fc1cea65872a7a0
GitHub-Pull-Request: golang/oauth2#298
Reviewed-by: Brad Fitzpatrick <>
2 files changed
tree: db7f864490411c0ad7869be126f2902b6975ac90
  1. amazon/
  2. bitbucket/
  3. cern/
  4. clientcredentials/
  5. facebook/
  6. fitbit/
  7. foursquare/
  8. github/
  9. gitlab/
  10. google/
  11. heroku/
  12. hipchat/
  13. internal/
  14. jira/
  15. jws/
  16. jwt/
  17. kakao/
  18. linkedin/
  19. mailchimp/
  20. mailru/
  21. mediamath/
  22. microsoft/
  23. odnoklassniki/
  24. paypal/
  25. slack/
  26. spotify/
  27. stackoverflow/
  28. twitch/
  29. uber/
  30. vk/
  31. yahoo/
  32. yandex/
  33. .travis.yml
  37. example_test.go
  39. oauth2.go
  40. oauth2_test.go
  42. token.go
  43. token_test.go
  44. transport.go
  45. transport_test.go

OAuth2 for Go

Build Status GoDoc

oauth2 package contains a client implementation for OAuth 2.0 spec.


go get

Or you can manually git clone the repository to $(go env GOPATH)/src/

See godoc for further documentation and examples.

App Engine

In change 96e89be (March 2015), we removed the oauth2.Context2 type in favor of the context.Context type from the package

This means it‘s no longer possible to use the “Classic App Engine” appengine.Context type with the oauth2 package. (You’re using Classic App Engine if you import the package "appengine".)

To work around this, you may use the new "" package. This package has almost the same API as the "appengine" package, but it can be fetched with go get and used on “Managed VMs” and well as Classic App Engine.

See the new appengine package's readme for information on updating your app.

If you don't want to update your entire app to use the new App Engine packages, you may use both sets of packages in parallel, using only the new packages with the oauth2 package.

import (
	newappengine ""
	newurlfetch ""


func handler(w http.ResponseWriter, r *http.Request) {
	var c appengine.Context = appengine.NewContext(r)
	c.Infof("Logging a message with the old package")

	var ctx context.Context = newappengine.NewContext(r)
	client := &http.Client{
		Transport: &oauth2.Transport{
			Source: google.AppEngineTokenSource(ctx, "scope"),
			Base:   &newurlfetch.Transport{Context: ctx},

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see

The main issue tracker for the oauth2 repository is located at