diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/shared_config.rb b/gems/aws-sdk-core/lib/aws-sdk-core/shared_config.rb index 9be824ca38b..3180e05de51 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/shared_config.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/shared_config.rb @@ -385,7 +385,7 @@ def sso_credentials_from_profile(cfg, profile) sso_role_name: prof_config['sso_role_name'], sso_session: prof_config['sso_session'], sso_region: sso_region, - sso_start_url: prof_config['sso_start_url'] + sso_start_url: sso_start_url ) end end @@ -458,12 +458,8 @@ def determine_profile(options) end def sso_session(cfg, profile, sso_session_name) - sso_session = cfg["sso-session #{sso_session_name}"] - - if sso_session.nil? && sso_session_name.match(/\s/) - # aws sso-configure may add quotes around sso session names with whitespace - sso_session = cfg["sso-session '#{sso_session_name}'"] - end + # aws sso-configure may add quotes around sso session names with whitespace + sso_session = cfg["sso-session #{sso_session_name}"] || cfg["sso-session '#{sso_session_name}'"] unless sso_session raise ArgumentError,