Skip to content

[aws-cpp-sdk-core]: STS Web Identity Provider no longer caches - one-shot authentication only #4004

Closed

Description

@grrtrr

Describe the bug

In c6ed3e3, the STSAssumeRoleWebIdentityCredentialsProvider switched from Internal::STSCredentialsClient to CRT.

This is using aws_credentials_provider_new_sts_web_identity() via CreateCredentialsProviderSTSWebIdentity().

That chosen aws-c-auth credentials provider does not cache or refresh credentials. It is one-shot credentials provider.

This is evident in code and in logs. Any job running > 1 hour dies.

Log Examples

Example 1:

2026-11-19 05:59:36 Z   stderr INFO, 2026-11-19 05:59:36,034:b'I20261119 05:59:36.034477 140596569544256 run_critic.cc:479] --->>> [redacted, code starts to run]
...
2026-11-19 07:03:08 Z   stderr INFO, 2026-11-19 07:03:08,895:b'Exception name: ExpiredToken'
2026-11-19 07:03:08 Z   stderr INFO, 2026-11-19 07:03:08,895:b'Error message: Unable to parse ExceptionName: ExpiredToken Message: The provided token has expired.'

Example 2:

2026-11-19 02:30:27 Z   stdout cwd [redacted, code starts to run]
...
2026-11-19 03:34:47 Z   stdout Exception name: ExpiredToken
2026-11-19 03:34:47 Z   stdout Error message: Unable to parse ExceptionName: ExpiredToken Message: The provided token has expired.

Regression Issue

  • Select this option if this issue appears to be a regression.

The previous implementation refreshed viaReload(), RefreshIfExpired(), ExpiresSoon().

Possible Solution

Should use CreateCredentialsProviderCached().

However, the code in aws-c-auth is not as production-tested as the previous implementation based on Aws::Internal::STSCredentialsClient, which had a proper retry configuration - see awslabs/aws-c-auth#311 and #3977.

Please could you consider reverting to use the AWSHttpResourceClient, as per the comment:

// src/aws-cpp-sdk-core/include/aws/core/auth/STSCredentialsProvider.h
/**
 * To support retrieving credentials of STS AssumeRole with web identity.
 * Note that STS accepts request with protocol of queryxml. Calling GetAWSCredentials() will trigger (if expired)
 * a query request using AWSHttpResourceClient under the hood.
 */
class AWS_CORE_API STSAssumeRoleWebIdentityCredentialsProvider : public CrtCredentialsProvider {
  //...
};
AWS CPP SDK version used

1.11.919 (problem present on main)

Compiler and Version used

clang-20

Operating System and version

ubuntu 24.04

Activity

  1. added
    bugThis issue is a bug.
    needs-triageThis issue or PR still needs to be triaged.
    on Nov 19, 2026
  2. grrtrr commented on Nov 21, 2026

    @grrtrr
    ContributorAuthor

    Wrong conclusion

    Caching is NOT required, since STSAssumeRoleWebIdentityCredentialsProvider subclasses CrtCredentialsProvider, which calls Reload() if the credentials are within 5 minutes of their expiration time (RefreshIfExpired()).

    The symptoms we were seeing and the expiration in the logs were due to a different code path, which has nothing to do with the STS Web Identity provider.

    Will create an issue once the root cause is clear.

  3. github-actions commented on Nov 21, 2026

    @github-actions

    This issue is now closed. Comments on closed issues are hard for our team to see.
    If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions