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 <string>
15 #include <vector>
16 
17 namespace Azure { namespace Identity {
18  namespace _detail {
19  class ChainedTokenCredentialImpl;
20  }
21 
28  class ChainedTokenCredential final : public Core::Credentials::TokenCredential {
29  public:
34  using Sources = std::vector<std::shared_ptr<Core::Credentials::TokenCredential>>;
35 
42  explicit ChainedTokenCredential(Sources sources);
43 
49 
58  Core::Credentials::AccessToken GetToken(
59  Core::Credentials::TokenRequestContext const& tokenRequestContext,
60  Core::Context const& context) const override;
61 
62  private:
63  std::unique_ptr<_detail::ChainedTokenCredentialImpl> m_impl;
64  };
65 
66 }} // namespace Azure::Identity
Chained Token Credential provides a token credential implementation which chains multiple Azure::Core...
Definition: chained_token_credential.hpp:28
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition: chained_token_credential.cpp:27
~ChainedTokenCredential() override
Destructs ChainedTokenCredential.
ChainedTokenCredential(Sources sources)
Constructs a Chained Token Credential.
Definition: chained_token_credential.cpp:19
std::vector< std::shared_ptr< Core::Credentials::TokenCredential > > Sources
A container type to store the ordered chain of credentials.
Definition: chained_token_credential.hpp:34
Azure SDK abstractions.
Definition: azure_cli_credential.hpp:22