azure-identity
managed_identity_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 #include <azure/core/credentials/token_credential_options.hpp>
13 
14 #include <memory>
15 #include <string>
16 
17 namespace Azure { namespace Identity {
18  namespace _detail {
19  class ManagedIdentitySource;
20  }
21 
26  class ManagedIdentityCredential final : public Core::Credentials::TokenCredential {
27  private:
28  std::unique_ptr<_detail::ManagedIdentitySource> m_managedIdentitySource;
29 
30  public:
36 
44  std::string const& clientId = std::string(),
45  Azure::Core::Credentials::TokenCredentialOptions const& options
46  = Azure::Core::Credentials::TokenCredentialOptions());
47 
54  Azure::Core::Credentials::TokenCredentialOptions const& options);
55 
66  Core::Credentials::AccessToken GetToken(
67  Core::Credentials::TokenRequestContext const& tokenRequestContext,
68  Core::Context const& context) const override;
69  };
70 
71 }} // namespace Azure::Identity
Client Secret Credential authenticates with the Azure services using a Tenant ID, Client ID and a cli...
Definition: managed_identity_credential.hpp:26
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition: managed_identity_credential.cpp:60
ManagedIdentityCredential(std::string const &clientId=std::string(), Azure::Core::Credentials::TokenCredentialOptions const &options=Azure::Core::Credentials::TokenCredentialOptions())
Constructs a Managed Identity Credential.
Definition: managed_identity_credential.cpp:46
~ManagedIdentityCredential() override
Destructs TokenCredential.
Azure SDK abstractions.
Definition: azure_cli_credential.hpp:22