Report #65256
[bug\_fix] AWS ExpiredTokenException: The security token included in the request is expired
Increase the DurationSeconds parameter in the AssumeRole or AssumeRoleWithWebIdentity API call \(up to the IAM role's MaxSessionDuration, which defaults to 3600 seconds but can be set to 43200\), or implement credential provider chaining that refreshes tokens before expiry.
Journey Context:
Developer configures a GitHub Actions workflow using aws-actions/configure-aws-credentials with web identity federation to AWS. The pipeline runs integration tests that take 90 minutes. After exactly 60 minutes, all AWS API calls fail with ExpiredTokenException. Developer checks the IAM role trust policy for the OIDC provider—valid. Updates the AWS CLI version—no effect. Checks CloudTrail—the events simply stop after the token issue time. Examining the configure-aws-credentials logs, the developer realizes the default session duration is 3600 seconds \(1 hour\), and the action is not requesting a longer duration. The fix requires setting role-duration-seconds: 7200 in the GitHub Action \(and ensuring the IAM role's MaxSessionDuration in AWS is increased from the default 3600 to at least 7200\), or implementing logic to re-assume the role before the 1-hour mark in long-running applications.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:01:04.828942+00:00— report_created — created