You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AWS SDK is unable to read locally AWS profile credentials (in .aws/credentials) if the keys are all upper case. It requires the keys to all lower case.
Successfully reads credentials
aws_access_key_id= ...
aws_secret_access_key= ...
aws_session_token= ...
Fails silently
AWS_ACCESS_KEY_ID= ...
AWS_SECRET_ACCESS_KEY= ...
AWS_SESSION_TOKEN= ...
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
AWS SDK should be case insensitive to the casing of the credentials keys in the .aws/credentials file.
Current Behavior
AWS SDK only supports (able to read) lowered case credentials keys in the .aws/credentials file.
Reproduction Steps
I used this code to figure out the key case sensitivity issue.
Try this code to test with all 1/ lowered case keys and then 2/ upper case keys.
// Credential validation methodvoidValidateAwsCredentials(){try{// Attempt to load credentials from default profilevarchain=newCredentialProfileStoreChain();if(chain.TryGetAWSCredentials("default",outvarawsCredentials)){Console.WriteLine("Credentials successfully loaded from profile");// Create STS client to validate credentialsusingvarstsClient=newAmazonSecurityTokenServiceClient(awsCredentials);// Get caller identityvarrequest=newGetCallerIdentityRequest();varresponse=stsClient.GetCallerIdentityAsync(request).Result;Console.WriteLine($"Account: {response.Account}");Console.WriteLine($"User ID: {response.UserId}");Console.WriteLine($"ARN: {response.Arn}");}else{Console.WriteLine("Failed to load AWS credentials from default profile");}}catch(Exceptionex){Console.WriteLine($"Credential Validation Error: {ex.Message}");}}
Possible Solution
No response
Additional Information/Context
Commonly, we configure such credentials using 'aws configure' command which adds all lowered case keys.
I used IAM Role temp credentials. So, from the AWS console, I copied and pasted the generated key/value pairs - generated keys are all upper case. After updating the .aws/credential file with the upper case keys, the AWS logger stopped writing to the AWS CloudWatch. Only after changing keys to all lower case, AWS logger started to work.
AWS .NET SDK and/or Package version used
net9.0
AWS.Logger.AspNetCore, Version=3.5.3
Targeted .NET Platform
net9.0
Operating System and version
Ubuntu 24
The text was updated successfully, but these errors were encountered:
shahzadhuq
changed the title
AWS SDK: .aws profile credential fetch is NOT case insensitive (keys must be lowered case)
AWS SDK requires .aws credential keys to be lowered case (expectation: case insensitive)
Jan 31, 2025
Describe the bug
AWS SDK is unable to read locally AWS profile credentials (in .aws/credentials) if the keys are all upper case. It requires the keys to all lower case.
Successfully reads credentials
Fails silently
Regression Issue
Expected Behavior
AWS SDK should be case insensitive to the casing of the credentials keys in the .aws/credentials file.
Current Behavior
AWS SDK only supports (able to read) lowered case credentials keys in the .aws/credentials file.
Reproduction Steps
I used this code to figure out the key case sensitivity issue.
Try this code to test with all 1/ lowered case keys and then 2/ upper case keys.
Possible Solution
No response
Additional Information/Context
Commonly, we configure such credentials using 'aws configure' command which adds all lowered case keys.
I used IAM Role temp credentials. So, from the AWS console, I copied and pasted the generated key/value pairs - generated keys are all upper case. After updating the .aws/credential file with the upper case keys, the AWS logger stopped writing to the AWS CloudWatch. Only after changing keys to all lower case, AWS logger started to work.
AWS .NET SDK and/or Package version used
Targeted .NET Platform
net9.0
Operating System and version
Ubuntu 24
The text was updated successfully, but these errors were encountered: