Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gems/aws-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Unreleased Changes
------------------

* Issue - Fix `login_credentials` in credentials chain when config is enabled.

3.239.1 (2025-11-21)
------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ def login_credentials(options)
return unless Aws.shared_config.config_enabled?

profile_name = determine_profile_name(options)
Aws.shared_config.login_credentials_from_config(profile: profile_name, region: options[:config].region)
region = options[:config].region if options[:config]
Aws.shared_config.login_credentials_from_config(profile: profile_name, region: region)
rescue Errors::NoSuchProfileError
nil
end
Expand Down
5 changes: 5 additions & 0 deletions gems/aws-sdk-core/spec/aws/credential_provider_chain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ def validate_metrics(*expected_metrics)
it 'defaults to nil' do
expect(credentials).to be(nil)
end

it 'defaults to nil when config is enabled' do
Aws.shared_config.fresh(config_enabled: true)
expect(credentials).to be(nil)
end
end

describe 'with shared credentials' do
Expand Down
Loading