0

I'm having a problem with my Presigned downloand URL

 using (var S3Client = new AmazonS3Client(AppSettings.AwsAccessKey, AppSettings.AwsSecretKey, Amazon.RegionEndpoint.USEast1))
            {
                GetPreSignedUrlRequest request = new GetPreSignedUrlRequest
                {
                    BucketName = AppSettings.AwsS3BucketName,
                    Key = Filename,
                    Expires = DateTime.Now.AddSeconds(ExpirationSeconds),                        
                    Verb = HttpVerb.GET
                };
                return S3Client.GetPreSignedURL(request);
            }

usually I put 10 - 30 second on for expiration and over the sudden I start receiving a message that my URL is expired.

<Error>
  <Code>AccessDenied</Code>
  <Message>Request has expired</Message>
  <Expires>2016-05-04T11:21:39Z</Expires>
  <ServerTime>2016-05-04T11:22:12Z</ServerTime>
  <RequestId>F329329970936A18</RequestId>
  <HostId>womi/k5E9ffDDa6PffCcWBMYzUF2i4oRIY+QX6R/6v0IjQlipYA2OKBPQOflkoLIl4+wk6So7Ks=</HostId>
</Error>

Date difference is too big. What's wrong with that?

Michael Samteladze
  • 1,310
  • 15
  • 38

1 Answers1

0

Your local machine time is likely different to the AWS time.

I had a similar problem where my machine resumed from sleep mode and was 15mins adrift of real time.

Lou O.
  • 599
  • 4
  • 17