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>
23namespace Azure {
namespace Identity {
25 class TokenCredentialImpl;
27 void FreePrivateKeyImpl(
void* pkey);
29 template <
typename>
struct UniquePrivateKeyHelper;
30 template <>
struct UniquePrivateKeyHelper<void*>
32 static void FreePrivateKey(
void* pkey) { FreePrivateKeyImpl(pkey); }
33 using type = Azure::Core::_internal::BasicUniqueHandle<void, FreePrivateKey>;
36 using UniquePrivateKey = Azure::Core::_internal::UniqueHandle<void*, UniquePrivateKeyHelper>;
55 std::string
AuthorityHost = _detail::DefaultOptionValues::GetAuthorityHost();
82 _detail::TokenCache m_tokenCache;
83 _detail::ClientCredentialCore m_clientCredentialCore;
84 std::unique_ptr<_detail::TokenCredentialImpl> m_tokenCredentialImpl;
85 std::string m_requestBody;
86 std::string m_tokenPayloadStaticPart;
87 std::string m_tokenHeaderEncoded;
88 _detail::UniquePrivateKey m_pkey;
92 std::string
const& clientId,
93 std::string
const& clientCertificatePath,
94 std::string
const& authorityHost,
95 std::vector<std::string> additionallyAllowedTenants,
96 bool sendCertificateChain,
97 Core::Credentials::TokenCredentialOptions
const& options);
100 std::string tenantId,
101 std::string
const& clientId,
102 std::string
const& clientCertificate,
103 std::string
const& privateKey,
104 std::string
const& authorityHost,
105 std::vector<std::string> additionallyAllowedTenants,
106 bool sendCertificateChain,
107 Core::Credentials::TokenCredentialOptions
const& options);
120 std::string tenantId,
121 std::string
const& clientId,
122 std::string
const& clientCertificatePath,
123 Core::Credentials::TokenCredentialOptions
const& options
124 = Core::Credentials::TokenCredentialOptions());
138 std::string tenantId,
139 std::string
const& clientId,
140 std::string
const& clientCertificate,
141 std::string
const& privateKey,
154 std::string tenantId,
155 std::string
const& clientId,
156 std::string
const& clientCertificatePath,
173 Core::Credentials::AccessToken
GetToken(
174 Core::Credentials::TokenRequestContext
const& tokenRequestContext,
175 Core::Context
const& context)
const override;
Client Certificate Credential authenticates with the Azure services using a Tenant ID,...
Definition client_certificate_credential.hpp:80
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition client_certificate_credential.cpp:678
~ClientCertificateCredential() override
Destructs ClientCertificateCredential.
Options for client certificate authentication.
Definition client_certificate_credential.hpp:44
bool SendCertificateChain
SendCertificateChain controls whether the credential sends the public certificate chain in the x5c he...
Definition client_certificate_credential.hpp:72
std::vector< std::string > AdditionallyAllowedTenants
For multi-tenant applications, specifies additional tenants for which the credential may acquire toke...
Definition client_certificate_credential.hpp:62
std::string AuthorityHost
Authentication authority URL.
Definition client_certificate_credential.hpp:55