papiayeee / oauth-signpost

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

Timestamp : Seconds vs Milliseconds #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Service Provider, the timestamp is expressed in the number of seconds since 
January 1, 1970 
00:00:00 GMT

The current implementation uses milliseconds:

DefaultOAuthConsumer.java:97
map.put(OAuth.OAUTH_TIMESTAMP, Long.toString(System.currentTimeMillis()));

Google's OAuth implementation checks the timestamp and issues a "timestamp is 
too far from 
current time" error if milliseconds are used.

Dividing by 1000 fixes the problem (and lets me access the Google Portable 
Contacts API using 
OAuth)

Original issue reported on code.google.com by ckstj...@gmail.com on 7 May 2009 at 10:33

GoogleCodeExporter commented 8 years ago
Hmm, that got mangled. The first paragraph should read: 

http://oauth.net/core/#nonce. 8. Nonce and Timestamp Unless otherwise specified 
by the Service Provider, the 
timestamp is expressed in the number of seconds since January 1, 1970 00:00:00 
GMT. 

Original comment by ckstj...@gmail.com on 7 May 2009 at 10:35

GoogleCodeExporter commented 8 years ago
Will change this asap.

Original comment by m.kaepp...@gmail.com on 13 May 2009 at 3:47

GoogleCodeExporter commented 8 years ago
Fixed in http://code.google.com/p/oauth-signpost/source/detail?r=16

Original comment by m.kaepp...@gmail.com on 13 May 2009 at 8:12