azure-identity
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Azure::Identity::DefaultAzureCredential Class Referencefinal

Default Azure Credential combines multiple credentials that depend on the setup environment and require no parameters into a single chain. If the environment is set up sufficiently for at least one of such credentials to work, DefaultAzureCredential will work as well. More...

#include <default_azure_credential.hpp>

Inheritance diagram for Azure::Identity::DefaultAzureCredential:

Public Member Functions

 DefaultAzureCredential ()
 Constructs DefaultAzureCredential.
 
 DefaultAzureCredential (Core::Credentials::TokenCredentialOptions const &options)
 Constructs DefaultAzureCredential.
 
 ~DefaultAzureCredential () override
 Destructs DefaultAzureCredential.
 
Core::Credentials::AccessToken GetToken (Core::Credentials::TokenRequestContext const &tokenRequestContext, Core::Context const &context) const override
 Gets an authentication token.
 

Detailed Description

This credential is using several credentials in the following order: Azure::Identity::EnvironmentCredential, Azure::Identity::WorkloadIdentityCredential, Azure::Identity::AzureCliCredential, and Azure::Identity::ManagedIdentityCredential. Even though the credentials being used and their order is documented, it may be changed in the future versions of the SDK, potentially introducing breaking changes in its behavior.

Note
This credential is intended to be used at the early stages of development, to allow the developer some time to work with the other aspects of the SDK, and later to replace this credential with the exact credential that is the best fit for the application. It is not intended to be used in a production environment.

Constructor & Destructor Documentation

◆ DefaultAzureCredential() [1/2]

Azure::Identity::DefaultAzureCredential::DefaultAzureCredential ( )
inlineexplicit

◆ DefaultAzureCredential() [2/2]

DefaultAzureCredential::DefaultAzureCredential ( Core::Credentials::TokenCredentialOptions const &  options)
explicit
Parameters
optionsGeneric Token Credential Options.

◆ ~DefaultAzureCredential()

DefaultAzureCredential::~DefaultAzureCredential ( )
overridedefault

Member Function Documentation

◆ GetToken()

AccessToken DefaultAzureCredential::GetToken ( Core::Credentials::TokenRequestContext const &  tokenRequestContext,
Core::Context const &  context 
) const
override
Parameters
tokenRequestContextA context to get the token in.
contextA context to control the request lifetime.
Exceptions
Azure::Core::Credentials::AuthenticationExceptionAuthentication error occurred.

The documentation for this class was generated from the following files: