116 Commits

Author SHA1 Message Date
Brad Fitzpatrick
f5b40b26f1 oauth2: use a JSON struct types instead of empty interface maps
Change-Id: Ifd66ea35c15dbd14acca0c945b533ec755de12e4
Reviewed-on: https://go-review.googlesource.com/1872
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-20 06:52:21 +00:00
Brad Fitzpatrick
9abe144dd5 oauth2: move Token into its own file (no code changes)
Change-Id: I5248f48cc1af68a0f78a8ddf7e28b91a729f5460
Reviewed-on: https://go-review.googlesource.com/1870
Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-19 04:29:46 +00:00
Dave Day
7bbf2199a5 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>
2014-12-17 00:04:06 +00:00
Johan Euphrosine
a360c4ed80 oauth2: fix typo
Change-Id: Ic39a63c50a042ab836bbc496db9aea7fb52870d2
Reviewed-on: https://go-review.googlesource.com/1652
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-16 18:11:04 +00:00
Burcu Dogan
9b6b7610ad oauth2: rewrite google package, fix the broken build
Change-Id: I2753a88d7be483bdbc0cac09a1beccc4806ea4bc
Reviewed-on: https://go-review.googlesource.com/1361
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-16 06:20:58 +00:00
Brad Fitzpatrick
a568078818 oauth2: redesign the API
Tests and examples aren't updated yet. The tree will be broken after this,
but nobody should be using this yet anyway.

Change-Id: I0004c738f40919ab46d107c71c011c510fbc748f
Reviewed-on: https://go-review.googlesource.com/1246
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-16 06:20:49 +00:00
Andrew Gerrand
3ec35f1969 Merge branch 'master' of https://github.com/golang/oauth2 2014-11-28 10:17:23 +11:00
Burcu Dogan
e750a2fd5a oauth2: add vanity URL import comments, use the vanity URL on builds
Change-Id: Ia20e40d98aa709e3d598388e0a15501584152ab5
2014-11-26 11:47:34 -08:00
Burcu Dogan
5fd31d511c Merge pull request #50 from snikch/fix-json-expiry
Handle expiry correctly in json response
2014-11-25 19:48:01 -08:00
Burcu Dogan
b846388564 oauth2: Removing the inconsistent and duplicate features, better naming
- Removed Flow, flow is a nothing but options.
- Renamed Cacher to Storer.
- Removed the setter from the Transport. Store should do the initial set.
  Getter is not removed, because extra fields are available through
  Transport.Token.Extra(). It's not pleasant to implement a custom Storer
  implementation to read such values.

oauth2: Remove VMs from the AppEngine example title
2014-11-25 14:36:49 -08:00
Mal Curtis
778494f9ec Handle expiry correctly in json response
Go treats json numbers as float64 not int. Previously json response
expiry information was ignored since it was expected to be an int.
2014-11-21 13:07:44 +13:00
Burcu Dogan
c048af9da2 Add Cacher interface. 2014-11-13 15:41:14 +11:00
Burcu Dogan
2d3ce25e9a Don't mutate the authorization endpoint.
Flow should be reusable, Options object should not be
mutated by the calls performed on the flow.
2014-11-12 10:02:14 +11:00
Burcu Dogan
0b8fcbadce Avoid setting an explicit token fetcher for the known flows. 2014-11-11 11:22:30 +11:00
Burcu Dogan
0cf6f9b144 Introduce an option function type
- Reduce the duplicate code by merging the flows and
determining the flow type by looking at the provided options.
- Options as a function type allows us to validate an individual
an option in its scope and makes it easier to compose the
built-in options with the third-party ones.
2014-11-08 09:46:26 +11:00
Burcu Dogan
0ae3d4edc9 Allow users to get extra fields from a token response. 2014-10-27 20:01:11 -07:00
Burcu Dogan
4b407cace1 Support token expiration for Facebook OAuth 2.0.
Facebook's OAuth 2.0 implementation seems to be broken and
returns expires_in value in expires. Fallback to expires field to
handle the expiration time for Facebook.
2014-10-21 10:43:33 -07:00
Matt Jibson
123b41c5cb Add SoundCloud to the providers not supporting Auth headers 2014-10-04 02:16:01 -04:00
Matt Jibson
311200b953 Spelling 2014-10-04 02:15:35 -04:00
CL Sung
099e4f09b0 Add Linkedin to the providers not supporting Auth headers. 2014-09-11 10:49:49 +08:00
Burcu Dogan
85a0f4506d Merge pull request #37 from stacktic/DropboxAuthFix
Add Dropbox to the providers not supporting Auth headers.
2014-09-08 09:59:12 -07:00
Arnaud Ysmal
e6396819be Add Dropbox to the providers not supporting Auth headers.
Dropbox does not support mixing URL param and Auth header for authentication but the retrieveToken method forces the client_id to be sent in the URL param.
2014-09-07 19:05:03 +02:00
JT Olds
e68820a209 fix token exchange 2014-09-06 17:39:43 -06:00
Burcu Dogan
97a89b3be5 Access type and approval prompt should be set at URL generation. 2014-09-04 23:30:06 -07:00
Burcu Dogan
cb029f4c1f Fix error message prefix. 2014-09-04 13:33:06 -07:00
Burcu Dogan
bb8496880f Don't assume optional fields are required and use Basic Auth if available.
See https://github.com/golang/oauth2/issues/33
2014-09-04 13:28:18 -07:00
Burcu Dogan
32b8a902e6 client_secret should be optional. 2014-09-04 12:03:06 -07:00
Burcu Dogan
cd4a6ded37 Removing non-required initial Client and Transport values. 2014-09-04 11:58:35 -07:00
Burcu Dogan
948919caa0 Merge branch 'httpclient' 2014-09-03 18:04:35 -07:00
Alif Rachmawadi
eae9d0e836 removed NewTransport inline example 2014-09-03 08:27:29 +07:00
Burcu Dogan
8524783bd7 Allow configs to be initialised with zero values for Client and Transport. 2014-09-02 14:06:51 -07:00
Alif Rachmawadi
e049d530c3 fixed NewTransport example code 2014-09-02 21:17:45 +07:00
Burcu Dogan
32b45383ad Managed VM users should depend on http.DefaultTransport by default. 2014-08-31 16:08:13 -07:00
Burcu Dogan
6bb0a5207a Do not assume that http.DefaultClient and http.DefaultTransport is always available. 2014-08-31 15:17:36 -07:00
Burcu Dogan
3a5e8819eb Rename exchange code to code, document as authorization code. 2014-08-16 21:21:58 -07:00
Burcu Dogan
ee77246177 Don't provide a Transport interface but provide a http.RoundTripper implementation. 2014-08-14 10:59:09 -07:00
Burcu Dogan
b314823c0b TokenFetcher should not mutate existing tokens. 2014-08-13 16:47:57 -07:00
Burcu Dogan
b2a1756f98 Merge branch 'scopes-omit' 2014-08-13 14:05:44 -07:00
Burcu Dogan
de4c4313f9 Adding required client_secret credential. 2014-08-13 13:59:53 -07:00
Burcu Dogan
f9dc7568c2 Docs improvements, lint error fixes. 2014-08-13 13:40:18 -07:00
Burcu Dogan
03e5fbeae0 Fixing json tags. 2014-08-12 23:42:30 -07:00
Burcu Dogan
a9dc52b3d3 Docs, code cleanups. 2014-08-12 19:50:34 -07:00
Burcu Dogan
4c579cbd0d Export exchange.
Allows users to exchange and retrieve a token
without initialising a Transport.
2014-08-11 00:27:43 -07:00
Arnaud Ysmal
87013cb7c2 Make AccessType, ApprovalPrompt and RedirectURL optional. 2014-07-31 21:06:10 +02:00
Burcu Dogan
067c73f77e Clone authURL. 2014-07-21 16:44:58 -07:00
Burcu Dogan
4ad15bb1fc Remove named return values. 2014-07-20 21:07:57 -07:00
Burcu Dogan
70bd497612 Fail during conf init if auth or token URL is not valid. 2014-07-20 16:56:38 -07:00
Burcu Dogan
6b4f2ed2ce Use default client rather than a new client instance. 2014-07-14 10:26:21 -07:00
Burcu Dogan
0f597d5ad4 oauth2: don't use http.DefaultTransport.
http.DefaultTransport is not available on App Engine.
2014-07-11 10:57:28 -07:00
Johan Euphrosine
93ad3f4a9e remove cache 2014-07-08 22:27:34 -07:00