Unsolved
This post is more than 5 years old
16 Posts
0
3109
The request timestamp was outside the valid time window.
Hi,
I am trying to retrieve shareableurl by passing expiration of 1 hour from now. This code works well in my offline server, however when I upload it on my Online server I get the following error "The request timestamp was outside the valid time window."
System.DateTime expiration = System.DateTime.Now.AddHours(1);
string shareableurl;
shareableurl = cloud.GetShareableUrl(path, expiration).ToString();
Please Help.
Thanks,
Ratish
rbala1
222 Posts
0
December 8th, 2011 04:00
Ratish,
This typically indicates that your server's time is more than 5 minutes plus/minus UTC. Atmos requires that the server time not be more than 5 minutes apart from UTC to prevent replay attacks.
Raj
ratish777
16 Posts
0
December 8th, 2011 05:00
Hi Raj,
Can you tell what change should I make to my code?
Thanks,
Ratish
ratish777
16 Posts
0
December 8th, 2011 05:00
Resolved it.
The issue was that my server was 6 hrs back from UTC and I put 1 hour, now I put hours more then 6 hours and it works now.
Thanks,
Ratish
rbala1
222 Posts
0
December 8th, 2011 05:00
The easiest thing to do is change the server time to be within 5 minutes of UTC.
rbala1
222 Posts
0
December 8th, 2011 06:00
Also, you can use the CalculateServerOffset() method to adjust the request timestamp accordingly when the server time is off.
Here's a thread that discusses this alternate solution.