Skip to content

Custom Credential Resolution Order in AWS SDK for .NET V4 #3836

@normj

Description

@normj

We need to provide mechanisms in V4's new DefaultAWSCredentialsIdentityResolver to allow users to change the order of the credential providers. This was a feature the now deprecated FallbackCredentialsFactory had which was used by users like @Vake93 in the discussion below.

In the meantime users will need to continue using the FallbackCredentialsFactory and since the service clients don't use FallbackCredentialsFactory they will need to directly use FallbackCredentialsFactory to resolve credentials and pass the credentials into the service client.

Discussed in #3834

Originally posted by Vake93 May 21, 2025
In AWS SDK for .NET V3, we were able to override the default credential resolution order by configuring:

FallbackCredentialsFactory.CredentialsGenerators = [
    AwsConfigCredentialsFactory.GetAwsCredentials,
    EnvironmentVariablesCredentials.FromEnvironmentVariables,
    AssumeRoleWithWebIdentityCredentials.FromEnvironmentVariables,
];

This allowed us to prioritize AWS Profiles and Environment Variables over Web Identity credentials, which aligns better with our use case.

However, in AWS SDK V4, FallbackCredentialsFactory is deprecated and no longer available. We're looking for guidance on how to achieve a similar customization of credential resolution order in V4.

Could you please advise on the recommended approach in V4 to achieve this?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions