• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..11-Oct-2018-

amazon/H11-Oct-2018-178

bitbucket/H11-Oct-2018-178

cern/H11-Oct-2018-178

clientcredentials/H11-Oct-2018-208149

facebook/H11-Oct-2018-178

fitbit/H11-Oct-2018-178

foursquare/H11-Oct-2018-178

github/H11-Oct-2018-178

gitlab/H11-Oct-2018-178

google/H11-Oct-2018-1,5081,067

heroku/H11-Oct-2018-178

hipchat/H11-Oct-2018-6138

instagram/H11-Oct-2018-178

internal/H11-Oct-2018-480350

jira/H11-Oct-2018-354280

jws/H11-Oct-2018-230157

jwt/H11-Oct-2018-419322

kakao/H11-Oct-2018-178

linkedin/H11-Oct-2018-178

mailchimp/H11-Oct-2018-188

mailru/H11-Oct-2018-178

mediamath/H11-Oct-2018-2312

microsoft/H11-Oct-2018-3217

nokiahealth/H11-Oct-2018-178

odnoklassniki/H11-Oct-2018-178

paypal/H11-Oct-2018-2312

slack/H11-Oct-2018-178

spotify/H11-Oct-2018-178

stackoverflow/H11-Oct-2018-178

twitch/H11-Oct-2018-208

uber/H11-Oct-2018-178

vk/H11-Oct-2018-178

yahoo/H11-Oct-2018-188

yandex/H11-Oct-2018-178

.travis.ymlH A D11-Oct-2018262 1410

AUTHORSH A D11-Oct-2018173 43

CONTRIBUTING.mdH A D11-Oct-2018924 2717

CONTRIBUTORSH A D11-Oct-2018170 43

LICENSEH A D11-Oct-20181.4 KiB2824

README.mdH A D11-Oct-20182.5 KiB7856

example_test.goH A D11-Oct-20182.4 KiB9059

oauth2.goH A D11-Oct-201811.7 KiB363181

oauth2_test.goH A D11-Oct-201818.2 KiB552514

token.goH A D11-Oct-20184.8 KiB176102

token_test.goH A D11-Oct-20182 KiB7364

transport.goH A D11-Oct-20183.2 KiB145105

transport_test.goH A D11-Oct-20184 KiB169153

README.md

1# OAuth2 for Go
2
3[![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2)
4[![GoDoc](https://godoc.org/golang.org/x/oauth2?status.svg)](https://godoc.org/golang.org/x/oauth2)
5
6oauth2 package contains a client implementation for OAuth 2.0 spec.
7
8## Installation
9
10~~~~
11go get golang.org/x/oauth2
12~~~~
13
14Or you can manually git clone the repository to
15`$(go env GOPATH)/src/golang.org/x/oauth2`.
16
17See godoc for further documentation and examples.
18
19* [godoc.org/golang.org/x/oauth2](http://godoc.org/golang.org/x/oauth2)
20* [godoc.org/golang.org/x/oauth2/google](http://godoc.org/golang.org/x/oauth2/google)
21
22
23## App Engine
24
25In change 96e89be (March 2015), we removed the `oauth2.Context2` type in favor
26of the [`context.Context`](https://golang.org/x/net/context#Context) type from
27the `golang.org/x/net/context` package
28
29This means it's no longer possible to use the "Classic App Engine"
30`appengine.Context` type with the `oauth2` package. (You're using
31Classic App Engine if you import the package `"appengine"`.)
32
33To work around this, you may use the new `"google.golang.org/appengine"`
34package. This package has almost the same API as the `"appengine"` package,
35but it can be fetched with `go get` and used on "Managed VMs" and well as
36Classic App Engine.
37
38See the [new `appengine` package's readme](https://github.com/golang/appengine#updating-a-go-app-engine-app)
39for information on updating your app.
40
41If you don't want to update your entire app to use the new App Engine packages,
42you may use both sets of packages in parallel, using only the new packages
43with the `oauth2` package.
44
45```go
46import (
47	"golang.org/x/net/context"
48	"golang.org/x/oauth2"
49	"golang.org/x/oauth2/google"
50	newappengine "google.golang.org/appengine"
51	newurlfetch "google.golang.org/appengine/urlfetch"
52
53	"appengine"
54)
55
56func handler(w http.ResponseWriter, r *http.Request) {
57	var c appengine.Context = appengine.NewContext(r)
58	c.Infof("Logging a message with the old package")
59
60	var ctx context.Context = newappengine.NewContext(r)
61	client := &http.Client{
62		Transport: &oauth2.Transport{
63			Source: google.AppEngineTokenSource(ctx, "scope"),
64			Base:   &newurlfetch.Transport{Context: ctx},
65		},
66	}
67	client.Get("...")
68}
69```
70
71## Report Issues / Send Patches
72
73This repository uses Gerrit for code changes. To learn how to submit changes to
74this repository, see https://golang.org/doc/contribute.html.
75
76The main issue tracker for the oauth2 repository is located at
77https://github.com/golang/oauth2/issues.
78