Donbenorden / oauth-signpost

Automatically exported from code.google.com/p/oauth-signpost
0 stars 0 forks source link

OAuthGoogleExample not executing #59

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
BEFORE YOU POST A NEW ISSUE, PLEASE CHECK THAT...

1) ... you are absolutely 100% sure that it's a bug in Signpost, and not a
problem related to the service provider you're using, or with your own code

2) ... if you're even slightly unsure about 1), post your problem to the
mailing list first, it's much more likely that you get help there:
http://groups.google.com/group/signpost-users

3) If 1) and 2) check out, always post an executable piece of code that
let's me reproduce the issue, otherwise I feel inclined to immediately
reject it

If you're still sure you found a bug, please follow the steps below.
REMOVE THIS MESSAGE BEFORE PROCEEDING.

--

In which environment did the problem appear?
- Sun Java (which version?)
- Android/Harmony (which version?)

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

Please post code (fully executable, no pseudo code) that reproduces the
issue.

Please provide any additional information below.

Compiling the code from example 
http://github.com/kaeppler/signpost-examples/blob/master/OAuthGoogleExample/src/
GoogleMain.java and executing it is giving me following exception:

Exception in thread "main" 
oauth.signpost.exception.OAuthCommunicationException: Communication with the 
service provider failed: Server returned HTTP response code: 400 for URL: 
https://www.google.com/accounts/OAuthGetRequestToken?scope=http%3A%2F%2Fwww.blog
ger.com%2Ffeeds
  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
  at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
  at test.main(test.java:37)
Caused by: java.io.IOException: Server returned HTTP response code: 400 for 
URL: 
https://www.google.com/accounts/OAuthGetRequestToken?scope=http%3A%2F%2Fwww.blog
ger.com%2Ffeeds
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
  at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1324)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1318)
  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:972)
  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
  at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnectionResponseAdapter.java:18)
  at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:228)
  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)
  ... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for 
URL: 
https://www.google.com/accounts/OAuthGetRequestToken?scope=http%3A%2F%2Fwww.blog
ger.com%2Ffeeds
  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1269)
  at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:391)
  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
  at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getStatusCode(HttpURLConnectionResponseAdapter.java:22)
  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:178)
  ... 2 more

Original issue reported on code.google.com by *an...@justlynx.com on 26 Oct 2010 at 9:47

GoogleCodeExporter commented 8 years ago
sorry for, forgetting to remove the instructions

Original comment by *an...@justlynx.com on 26 Oct 2010 at 9:48

GoogleCodeExporter commented 8 years ago
solved it, this is at least third time, I got into the same issue... I am using 
Virtual machine using VBox for development, on EOD I hibernate my PC and VM 
clock get out of sync, and according to OAuth, server and client should not be 
offset by more than 5 minute. That's why I was having that exception.

But it could be an issue on signpost side, that it don't notify that error 
occurred due to time difference.

Original comment by *an...@justlynx.com on 26 Oct 2010 at 10:08