Start a Conversation

Unsolved

This post is more than 5 years old

R

3038

December 8th, 2011 03:00

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

222 Posts

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

16 Posts

December 8th, 2011 05:00

Hi Raj,

Can you tell what change should I make to my code?

Thanks,

Ratish

16 Posts

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

222 Posts

December 8th, 2011 05:00

The easiest thing to do is change the server time to be within 5 minutes of UTC.

222 Posts

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.

No Events found!

Top