-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new CustomSSOCredentialsProvider class that inherits from SSO…
…CredentialsProvider
- Loading branch information
1 parent
f25f37d
commit 5fd9a53
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/aws-cpp-sdk-core/include/aws/core/auth/CustomSSOCredentialsProvider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |