diff --git a/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp b/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp index 9247f7e33d3..3af06cf2ee5 100644 --- a/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp +++ b/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp @@ -602,33 +602,41 @@ namespace Aws SSOCredentialsClient::SSOCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration, Aws::Http::Scheme scheme, const Aws::String& region) : AWSHttpResourceClient(clientConfiguration, SSO_RESOURCE_CLIENT_LOG_TAG) { - (Aws::MakeUnique(SSO_RESOURCE_CLIENT_LOG_TAG)); + SetErrorMarshaller(Aws::MakeUnique(SSO_RESOURCE_CLIENT_LOG_TAG)); - m_endpoint = buildEndpoint(scheme, region, "portal.sso.", "federation/credentials"); - m_oidcEndpoint = buildEndpoint(scheme, region, "oidc.", "token"); + m_endpoint = buildEndpoint(scheme, region, "portal.sso.", "federation/credentials"); + m_oidcEndpoint = buildEndpoint(scheme, region, "oidc.", "token"); - AWS_LOGSTREAM_INFO(SSO_RESOURCE_CLIENT_LOG_TAG, "Creating SSO ResourceClient with endpoint: " << m_endpoint); + AWS_LOGSTREAM_INFO(SSO_RESOURCE_CLIENT_LOG_TAG, "Creating SSO ResourceClient with endpoint: " << m_endpoint); } - Aws::String SSOCredentialsClient::buildEndpoint(Aws::Http::Scheme scheme, const Aws::String& region, const Aws::String& domain, - const Aws::String& endpoint) { - Aws::StringStream ss; - if (scheme == Aws::Http::Scheme::HTTP) { - ss << "http://"; - } else { - ss << "https://"; - } - - static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTH_1); - static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTHWEST_1); - auto hash = Aws::Utils::HashingUtils::HashString(region.c_str()); - - AWS_LOGSTREAM_DEBUG(SSO_RESOURCE_CLIENT_LOG_TAG, "Preparing SSO client for region: " << region); - ss << domain << region << ".amazonaws.com/" << endpoint; - if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH) { - ss << ".cn"; - } - return ss.str(); + Aws::String SSOCredentialsClient::buildEndpoint( + Aws::Http::Scheme scheme, + const Aws::String& region, + const Aws::String& domain, + const Aws::String& endpoint) + { + Aws::StringStream ss; + if (scheme == Aws::Http::Scheme::HTTP) + { + ss << "http://"; + } + else + { + ss << "https://"; + } + + static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTH_1); + static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTHWEST_1); + auto hash = Aws::Utils::HashingUtils::HashString(region.c_str()); + + AWS_LOGSTREAM_DEBUG(SSO_RESOURCE_CLIENT_LOG_TAG, "Preparing SSO client for region: " << region); + ss << domain << region << ".amazonaws.com/" << endpoint; + if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH) + { + ss << ".cn"; + } + return ss.str(); } SSOCredentialsClient::SSOGetRoleCredentialsResult SSOCredentialsClient::GetSSOCredentials(const SSOGetRoleCredentialsRequest &request)