Highlighted
ratish777
6 Indium

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

0 Kudos
5 Replies
8 Krypton

Re: The request timestamp was outside the valid time window.

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

0 Kudos
ratish777
6 Indium

Re: The request timestamp was outside the valid time window.

Hi Raj,

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

Thanks,

Ratish

0 Kudos
8 Krypton

Re: The request timestamp was outside the valid time window.

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

0 Kudos
ratish777
6 Indium

Re: The request timestamp was outside the valid time window.

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

0 Kudos
8 Krypton

Re: The request timestamp was outside the valid time window.

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.

0 Kudos