phamngsinh / goauth2

Automatically exported from code.google.com/p/goauth2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Bad error message from failed updateToken; should TeeReader into bytes.Buffer #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Run this webapp demo with Facebook authentication: 
https://code.google.com/p/negentropia/source/browse/webserv/src/negentropia/samp
les/goauth2_webapp_demo.go
(See the source code from goauth2_webapp_demo.go for instructions.)

What is the expected output?

It should authenticate against Facebook.

What do you see instead?

callback: transp.Exchange(code): invalid character 'a' looking for beginning of 
value

What version of the product are you using?

go version go1.2.1 windows/amd64
go get code.google.com/p/goauth2/oauth

Please provide any additional information below.

In order to investigate the issue, I'm hitting an even more puzzling behavior. 
I have just cloned goauth2 into code.google.com/p/evertonmarques-goauth2/oauth, 
but
no changes have been made yet. However, when I use this cloned repo,
authentication against Facebook simply works!

This is how to reproduce:

1. Change goauth2_webapp_demo.go import to use 
code.google.com/p/evertonmarques-goauth2/oauth
2. go get code.google.com/p/evertonmarques-goauth2/oauth
3. Re-run go run goauth2_webapp_demo.go
4. Now authentication against Facebook will work!

Original issue reported on code.google.com by everton....@gmail.com on 14 Mar 2014 at 6:38

GoogleCodeExporter commented 8 years ago
updateToken doesn't preserve the server's response if the json Decode fails. It 
should tee reader it into a bytes.Buffer so the server's response can be 
included in the error message.

Original comment by bradfitz@golang.org on 10 Aug 2014 at 6:05

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 7fc9d958c834.

Original comment by a...@golang.org on 11 Aug 2014 at 11:24