11 #include "azure/identity/detail/client_credential_core.hpp"
14 #include <azure/core/credentials/credentials.hpp>
15 #include <azure/core/credentials/token_credential_options.hpp>
16 #include <azure/core/internal/unique_handle.hpp>
17 #include <azure/core/url.hpp>
23 namespace Azure {
namespace Identity {
25 class TokenCredentialImpl;
27 void FreePkeyImpl(
void* pkey);
29 template <
typename>
struct UniquePkeyHelper;
30 template <>
struct UniquePkeyHelper<void*>
32 static void FreePkey(
void* pkey) { FreePkeyImpl(pkey); }
33 using type = Azure::Core::_internal::BasicUniqueHandle<void, FreePkey>;
36 using UniquePkeyHandle = Azure::Core::_internal::UniqueHandle<void*, UniquePkeyHelper>;
53 std::string
AuthorityHost = _detail::ClientCredentialCore::AadGlobalAuthority;
70 _detail::TokenCache m_tokenCache;
71 _detail::ClientCredentialCore m_clientCredentialCore;
72 std::unique_ptr<_detail::TokenCredentialImpl> m_tokenCredentialImpl;
73 std::string m_requestBody;
74 std::string m_tokenPayloadStaticPart;
75 std::string m_tokenHeaderEncoded;
76 _detail::UniquePkeyHandle m_pkey;
80 std::string
const& clientId,
81 std::string
const& clientCertificatePath,
82 std::string
const& authorityHost,
83 std::vector<std::string> additionallyAllowedTenants,
84 Core::Credentials::TokenCredentialOptions
const& options);
97 std::string
const& clientId,
98 std::string
const& clientCertificatePath,
99 Core::Credentials::TokenCredentialOptions
const& options
100 = Core::Credentials::TokenCredentialOptions());
111 std::string tenantId,
112 std::string
const& clientId,
113 std::string
const& clientCertificatePath,
130 Core::Credentials::AccessToken
GetToken(
131 Core::Credentials::TokenRequestContext
const& tokenRequestContext,
132 Core::Context
const& context)
const override;
Client Certificate Credential authenticates with the Azure services using a Tenant ID,...
Definition: client_certificate_credential.hpp:68
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition: client_certificate_credential.cpp:206
ClientCertificateCredential(std::string tenantId, std::string const &clientId, std::string const &clientCertificatePath, Core::Credentials::TokenCredentialOptions const &options=Core::Credentials::TokenCredentialOptions())
Constructs a Client Secret Credential.
~ClientCertificateCredential() override
Destructs ClientCertificateCredential.
Azure SDK abstractions.
Definition: azure_cli_credential.hpp:22
Options for client certificate authentication.
Definition: client_certificate_credential.hpp:44
std::vector< std::string > AdditionallyAllowedTenants
For multi-tenant applications, specifies additional tenants for which the credential may acquire toke...
Definition: client_certificate_credential.hpp:60
std::string AuthorityHost
Authentication authority URL.
Definition: client_certificate_credential.hpp:53