13 #include <azure/core/credentials/credentials.hpp>
14 #include <azure/core/credentials/token_credential_options.hpp>
16 #include <azure/core/datetime.hpp>
22 namespace Azure {
namespace Identity {
39 = std::chrono::seconds(13);
54 #if !defined(TESTING_BUILD)
57 :
public Core::Credentials::TokenCredential {
59 _detail::TokenCache m_tokenCache;
60 std::vector<std::string> m_additionallyAllowedTenants;
61 std::string m_tenantId;
62 DateTime::duration m_cliProcessTimeout;
66 Core::Credentials::TokenCredentialOptions
const& options,
68 DateTime::duration cliProcessTimeout,
69 std::vector<std::string> additionallyAllowedTenants);
71 void ThrowIfNotSafeCmdLineInput(std::string
const& input, std::string
const& description)
const;
96 Core::Credentials::AccessToken
GetToken(
97 Core::Credentials::TokenRequestContext
const& tokenRequestContext,
98 Core::Context
const& context)
const override;
100 #if !defined(TESTING_BUILD)
105 virtual std::string GetAzCommand(std::string
const& scopes, std::string
const& tenantId)
const;
Enables authentication to Azure Active Directory using Azure CLI to obtain an access token.
Definition: azure_cli_credential.hpp:57
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition: azure_cli_credential.cpp:140
AzureCliCredential(Core::Credentials::TokenCredentialOptions const &options)
Constructs an Azure CLI Credential.
Azure SDK abstractions.
Definition: azure_cli_credential.hpp:22
Options for configuring the Azure::Identity::AzureCliCredential.
Definition: azure_cli_credential.hpp:27
std::string TenantId
The ID of the tenant to which the credential will authenticate by default. If not specified,...
Definition: azure_cli_credential.hpp:33
std::vector< std::string > AdditionallyAllowedTenants
For multi-tenant applications, specifies additional tenants for which the credential may acquire toke...
Definition: azure_cli_credential.hpp:46
DateTime::duration CliProcessTimeout
The CLI process timeout.
Definition: azure_cli_credential.hpp:39