Skip to content

Commit

Permalink
Added a new CustomSSOCredentialsProvider class that inherits from SSO…
Browse files Browse the repository at this point in the history
…CredentialsProvider
  • Loading branch information
bhavya2109sharma committed Sep 5, 2024
1 parent f25f37d commit 5fd9a53
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once

#include <aws/core/auth/SSOCredentialsProvider.h>
#include <aws/core/client/ClientConfiguration.h>

namespace Aws {
namespace Auth {
class AWS_CORE_API CustomSSOCredentialsProvider : public SSOCredentialsProvider {
public:
CustomSSOCredentialsProvider(const Aws::Client::ClientConfiguration& clientConfig)
: SSOCredentialsProvider(), m_clientConfig(clientConfig)
{
}

void Reload() override {
Aws::Client::ClientConfiguration config = m_clientConfig;
config.scheme = Aws::Http::Scheme::HTTPS;
config.region = m_ssoRegion;

m_client = Aws::MakeUnique<Aws::Internal::SSOCredentialsClient>(SSO_CREDENTIALS_PROVIDER_LOG_TAG, config);

SSOCredentialsProvider::Reload();
}

private:
Aws::Client::ClientConfiguration m_clientConfig;
};
} // namespace Auth
} // namespace Aws

0 comments on commit 5fd9a53

Please sign in to comment.