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 region configuration for LoginCredential's Signin client.

3.238.0 (2025-11-19)
------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def static_profile_login_credentials(options)
return unless Aws.shared_config.config_enabled? && options[:config]&.profile

with_metrics('CREDENTIALS_CODE') do
creds = Aws.shared_config.login_credentials_from_config(profile: options[:config].profile)
creds = Aws.shared_config.login_credentials_from_config(
profile: options[:config].profile,
region: options[:config].region
)
return unless creds

creds.metrics << 'CREDENTIALS_CODE'
Expand Down Expand Up @@ -170,7 +173,7 @@ 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)
Aws.shared_config.login_credentials_from_config(profile: profile_name, region: options[:config].region)
rescue Errors::NoSuchProfileError
nil
end
Expand Down
10 changes: 6 additions & 4 deletions gems/aws-sdk-core/lib/aws-sdk-core/shared_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ def sso_token_from_config(opts = {})
# file, if present.
def login_credentials_from_config(opts = {})
p = opts[:profile] || @profile_name
credentials = login_credentials_from_profile(@parsed_credentials, p)
credentials ||= login_credentials_from_profile(@parsed_config, p) if @parsed_config
credentials = login_credentials_from_profile(@parsed_credentials, p, opts[:region])
credentials ||= login_credentials_from_profile(@parsed_config, p, opts[:region]) if @parsed_config
credentials
end

Expand Down Expand Up @@ -479,10 +479,12 @@ def sso_token_from_profile(cfg, profile)
end
end

def login_credentials_from_profile(cfg, profile)
def login_credentials_from_profile(cfg, profile, region)
return unless @parsed_config && (prof_config = cfg[profile]) && prof_config['login_session']

creds = LoginCredentials.new(login_session: prof_config['login_session'])
cfg = { login_session: prof_config['login_session'] }
cfg[:region] = region if region
creds = LoginCredentials.new(cfg)
creds.metrics << 'CREDENTIALS_PROFILE_LOGIN'
creds
end
Expand Down
4 changes: 4 additions & 0 deletions gems/aws-sdk-core/spec/aws/login_credentials_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ module Aws
}
end

before do
allow_any_instance_of(LoginCredentials).to receive(:warn).with(/WARNING: OpenSSL 3.6.x/)
end

it 'refreshes the token' do
mock_token_file(login_session, cached_token)
client.stub_responses(:create_o_auth_2_token, signin_resp)
Expand Down
3 changes: 2 additions & 1 deletion services.json
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,8 @@
"models": "signer/2017-08-25"
},
"Signin": {
"models": "signin/2023-01-01"
"models": "signin/2023-01-01",
"gemName": "aws-sdk-core"
},
"SimSpaceWeaver": {
"models": "simspaceweaver/2022-10-28"
Expand Down
Loading