azure-identity
Loading...
Searching...
No Matches
client_assertion_credential.hpp
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
9#pragma once
10
11#include "azure/identity/detail/client_credential_core.hpp"
12
13#include <azure/core/credentials/token_credential_options.hpp>
14
15#include <string>
16#include <vector>
17
18namespace Azure { namespace Identity {
19 namespace _detail {
20 class ClientAssertionCredentialImpl;
21 } // namespace _detail
22
27 struct ClientAssertionCredentialOptions final : public Core::Credentials::TokenCredentialOptions
28 {
39 std::string AuthorityHost = _detail::DefaultOptionValues::GetAuthorityHost();
40
46 std::vector<std::string> AdditionallyAllowedTenants;
47 };
48
54 class ClientAssertionCredential final : public Core::Credentials::TokenCredential {
55 private:
56 std::unique_ptr<_detail::ClientAssertionCredentialImpl> m_impl;
57
58 public:
71 std::string tenantId,
72 std::string clientId,
73 std::function<std::string(Core::Context const&)> assertionCallback,
74 ClientAssertionCredentialOptions const& options = {});
75
81
92 Core::Credentials::AccessToken GetToken(
93 Core::Credentials::TokenRequestContext const& tokenRequestContext,
94 Core::Context const& context) const override;
95 };
96
97}} // namespace Azure::Identity
Credential which authenticates a Microsoft Entra service principal using a signed client assertion.
Definition client_assertion_credential.hpp:54
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Obtains an authentication token from Microsoft Entra ID, by calling the assertionCallback specified w...
Definition client_assertion_credential.cpp:157
~ClientAssertionCredential() override
Destructs ClientAssertionCredential.
Options used to configure the Client Assertion credential.
Definition client_assertion_credential.hpp:28
std::vector< std::string > AdditionallyAllowedTenants
For multi-tenant applications, specifies additional tenants for which the credential may acquire toke...
Definition client_assertion_credential.hpp:46
std::string AuthorityHost
Authentication authority URL.
Definition client_assertion_credential.hpp:39