azure-identity
Loading...
Searching...
No Matches
default_azure_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/core/credentials/credentials.hpp>
12#include <azure/core/credentials/token_credential_options.hpp>
13
14#include <memory>
15
16#if defined(_azure_TESTING_BUILD)
17class DefaultAzureCredential_CachingCredential_Test;
18#endif
19
20namespace Azure { namespace Identity {
21 namespace _detail {
22 class ChainedTokenCredentialImpl;
23 }
24
43 class DefaultAzureCredential final : public Core::Credentials::TokenCredential {
44
45#if defined(_azure_TESTING_BUILD)
46 // make tests classes friends to validate caching
47 friend class ::DefaultAzureCredential_CachingCredential_Test;
48#endif
49
50 public:
56 : DefaultAzureCredential(Core::Credentials::TokenCredentialOptions{}){};
57
63 explicit DefaultAzureCredential(Core::Credentials::TokenCredentialOptions const& options);
64
70
79 Core::Credentials::AccessToken GetToken(
80 Core::Credentials::TokenRequestContext const& tokenRequestContext,
81 Core::Context const& context) const override;
82
83 private:
84 std::unique_ptr<_detail::ChainedTokenCredentialImpl> m_impl;
85 };
86
87}} // namespace Azure::Identity
Default Azure Credential combines multiple credentials that depend on the setup environment and requi...
Definition default_azure_credential.hpp:43
DefaultAzureCredential()
Constructs DefaultAzureCredential.
Definition default_azure_credential.hpp:55
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition default_azure_credential.cpp:56
~DefaultAzureCredential() override
Destructs DefaultAzureCredential.