Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

ExpiredToken is retryable, but should not be #3581

@pwrmiller

Description

@pwrmiller

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
Using expired tokens results in retries. I've seen long runtimes of sts.getCallerIdentity, for example, retrying with an expired credential.

Is the issue in the browser/Node.js?
Node.js

If on Node.js, are you running this on AWS Lambda?
No.

Details of the browser/Node.js version
v15.3.0

SDK version number
aws-sdk@2.601

To Reproduce (observed behavior)
Use an expired credential, call sts.getCallerIdentity, observe that it retries using the expired credential

Expected behavior
Expired credentials should not be retried (since presumably they can never become un-expired). Or, if this is to account for clock skew or something nuanced like that, perhaps a sensible number of retries should be used (maybe just one?)

Additional context
This was observed in AWS CDK, on which I raised a bug here. There, @rix0rrr asserts that retrying retryable requests is appropriate, but that a request using an expired credential should not be retryable.

The offending code seems to be here.

Can you explain the logic of having expired tokens be explicitly retryable if this is intentional?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions