azure-identity
Loading...
Searching...
No Matches
managed_identity_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#include <string>
16
17namespace Azure { namespace Identity {
18 namespace _detail {
19 class ManagedIdentitySource;
20 }
21
29 class ManagedIdentityCredential final : public Core::Credentials::TokenCredential {
30 private:
31 std::unique_ptr<_detail::ManagedIdentitySource> m_managedIdentitySource;
32
33 public:
39
47 std::string const& clientId = std::string(),
48 Azure::Core::Credentials::TokenCredentialOptions const& options
49 = Azure::Core::Credentials::TokenCredentialOptions());
50
57 Azure::Core::Credentials::TokenCredentialOptions const& options);
58
69 Core::Credentials::AccessToken GetToken(
70 Core::Credentials::TokenRequestContext const& tokenRequestContext,
71 Core::Context const& context) const override;
72 };
73
74}} // namespace Azure::Identity
Attempts authentication using a managed identity that has been assigned to the deployment environment...
Definition managed_identity_credential.hpp:29
Core::Credentials::AccessToken GetToken(Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
Gets an authentication token.
Definition managed_identity_credential.cpp:59
~ManagedIdentityCredential() override
Destructs TokenCredential.