azure-identity
chained_token_credential.hpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 
9 #pragma once
10 
11 #include <azure/core/credentials/credentials.hpp>
12 
13 #include <memory>
14 #include <vector>
15 
16 namespace Azure { namespace Identity {
23  class ChainedTokenCredential final : public Core::Credentials::TokenCredential {
24  public:
29  using Sources = std::vector<std::shared_ptr<Core::Credentials::TokenCredential>>;
30 
37  explicit ChainedTokenCredential(Sources sources);
38 
44 
53  Core::Credentials::AccessToken GetToken(
54  Core::Credentials::TokenRequestContext const& tokenRequestContext,
55  Core::Context const& context) const override;
56 
57  private:
58  Sources m_sources;
59  };
60 
61 }} // namespace Azure::Identity
Azure::Identity::ChainedTokenCredential::ChainedTokenCredential
ChainedTokenCredential(Sources sources)
Constructs a Chained Token Credential.
Definition: chained_token_credential.cpp:14
Azure::Identity::ChainedTokenCredential
Chained Token Credential provides a token credential implementation which chains multiple Azure::Core...
Definition: chained_token_credential.hpp:23
Azure::Identity::ChainedTokenCredential::Sources
std::vector< std::shared_ptr< Core::Credentials::TokenCredential > > Sources
A container type to store the ordered chain of credentials.
Definition: chained_token_credential.hpp:29
Azure
Azure SDK abstractions.
Definition: chained_token_credential.hpp:16
Azure::Identity::ChainedTokenCredential::~ChainedTokenCredential
~ChainedTokenCredential() override
Destructs ChainedTokenCredential.
Azure::Identity::ChainedTokenCredential::GetToken
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition: chained_token_credential.cpp:21