To control the oauth_timestamp, pass it to the Java library as a
parameter.  There are several ways to do this.  You can pass it to
OAuthClient methods as a parameter; for example
client.getRequestToken(accessor, OAuthMessage.GET,
OAuth.newList("oauth_timestamp", yourValue)).  You can override
OAuthClient.invoke, to add the parameter to the given list and then
call super.invoke.  Or you can override
OAuthAccessor.newRequestMessage, to add the parameter to the given
list and then call super.newRequestMessage.

In this case, I suggest overriding OAuthClient.invoke.  It can choose
a timestamp, catch the 400 response and adjust the clock offset if
needed.  I suggest storing the clock offset as a property of the
OAuthConsumer.

Java's System.currentTimeMillis should not change when you change the
system time zone.  Of course, it should change when you change the
system clock.

On Feb 26, 12:14 pm, Mark <mar...@gmail.com> wrote:
> Sorry I'm still not understanding - I'm using the client java library
> from this project out of the box. So it seems to send across a
> timestamp taken from the system clock, which reflects whatever time
> zone the user's device is set to. What are my options in this case?
> One is to tell all my clients to change their device timezones to be
> in sync with my server's (not going to happen), the other is to modify
> the timestamp my clients send across using the client OAuth library,
> but I don't see where to do that. I'm using these classes:
>
>   OAuthConsumer
>   OAuthAccessor
>   OAuthClient
>
> is there a method in any of those to forcibly set the timestamp which
> is sent so I can make sure it's something within acceptable params?

-- 
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to oa...@googlegroups.com.
To unsubscribe from this group, send email to 
oauth+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/oauth?hl=en.

Reply via email to