# AccessDenied: Request has expired (presigned URL)

AWS error fixes · Updated 16 November 2026

**Short answer:** The presigned URL's lifetime has passed, or the temporary credentials it was signed with expired first, which is the usual surprise. A URL signed by a Lambda or EC2 role stops working when that role session expires, whatever expiry you asked for. Generate URLs on demand just before use, keep lifetimes short, and use long-term credentials or CloudFront signed URLs only when links must last days.

## What it looks like

The browser shows S3's XML error, which includes the timing details:

```
<Error>
  <Code>AccessDenied</Code>
  <Message>Request has expired</Message>
  <X-Amz-Expires>3600</X-Amz-Expires>
  <Expires>2026-11-16T10:41:07Z</Expires>
  <ServerTime>2026-11-16T12:03:55Z</ServerTime>
</Error>
```

Compare `Expires` with `ServerTime`. If the URL's own expiry has clearly passed, it's simply old. If the URL should still be valid but fails anyway, look at the credentials it was signed with. A different message, "The provided token has expired", points straight at expired session credentials.

## Causes

| Cause | How to tell |
|---|---|
| URL used after its `X-Amz-Expires` lifetime | `ServerTime` is after `Expires` |
| Signed with temporary credentials that expired sooner | URL contains `X-Amz-Security-Token`; fails well before the requested expiry |
| Signing machine's clock is wrong | Fresh URLs fail immediately, or expiry is off by a fixed amount |
| Signed URL cached and reused | An HTML page, API response or CDN cache holds an old link |
| Requested lifetime too long | Signing fails or the link is rejected; SigV4 presigned URLs can be valid for at most 7 days |

## Fix it

1. **Generate the URL when the user needs it**, not when a page or email is built. A short endpoint that returns a fresh URL on click avoids most expiry complaints.
2. **Match the lifetime to the credentials.** URLs from Lambda, ECS or EC2 roles can last at most as long as that role session, which is often a few hours. If links must last up to 7 days, sign them with a dedicated IAM user's keys that only have `s3:GetObject` on the relevant prefix, and weigh that against the risk of long-lived keys.
3. **For long-lived or many-file access**, use CloudFront signed URLs or signed cookies, which use a key pair you control rather than IAM session credentials.
4. **Fix the clock** on the signing host if fresh URLs fail (see [clock skew](https://cloudconsole.dev/errors/signature-expired-clock-skew)).
5. **Don't let caches keep signed links** past their lifetime: set `Cache-Control` on responses that contain them.

Test a URL from the CLI:

```
aws s3 presign s3://my-bucket/reports/2026-11.pdf --expires-in 900
curl -sI "$(aws s3 presign s3://my-bucket/reports/2026-11.pdf --expires-in 60)" | head -1
```

Check which identity the CLI signs with first (`aws sts get-caller-identity`); an SSO or assumed-role session will cap the URL's real lifetime.

## Mistakes to avoid

- Setting a 7-day expiry in a Lambda function and assuming links last a week. They last until the execution role's credentials rotate.
- Emailing presigned links to customers for downloads days later. Send a link to your app that generates a fresh URL instead.
- Thinking the URL can be revoked. Short of removing the signer's permissions or deleting the object, a valid presigned URL works until it expires, so keep lifetimes short.

## Questions

### How long can an S3 presigned URL be valid?

Up to 7 days with Signature Version 4, and never longer than the credentials used to sign it. URLs signed with temporary role credentials expire when that session does.

### Why does my presigned URL expire before the time I set?

It was signed with temporary credentials, from a Lambda, ECS or EC2 role or an SSO session, that expired before the URL's own expiry.

### What does Request has expired mean in S3?

S3 received a presigned request after its validity window. The error body shows the expiry time and S3's current time so you can compare them.

## When this happens away from your desk

Expired download links usually reach you as a support ticket rather than an alarm. CloudConsole, a phone app for AWS, is built to show alarms and logs on your phone, which helps when you need to check whether the failures are widespread or a single old link.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Sharing objects with presigned URLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html)
- [Serve private content with signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html)

## Related

- [aws s3 presign](https://cloudconsole.dev/cli/s3-presign)
- [S3 AccessDenied: Access Denied when calling an S3 operation](https://cloudconsole.dev/errors/s3-access-denied)
- [InvalidSignatureException: Signature expired](https://cloudconsole.dev/errors/signature-expired-clock-skew)
- [ExpiredToken: The security token included in the request is expired](https://cloudconsole.dev/errors/expiredtoken)
- [SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided](https://cloudconsole.dev/errors/signaturedoesnotmatch)
- [An error occurred (403) when calling the HeadObject operation: Forbidden](https://cloudconsole.dev/errors/s3-403-forbidden-headobject)

---

Source: https://cloudconsole.dev/errors/s3-request-has-expired

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
