Namespace Azure.Identity | Azure SDK for Net

Posted by Janel Helmers on Tuesday, June 18, 2024

AuthenticationFailedException

An exception class raised for errors in authenticating client requests.

AuthorizationCodeCredential

Authenticates by redeeming and authorization code previously obtained from Azure Active Directory. See https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow for more information about the autorization code authentication flow.

ChainedTokenCredential

Provides a TokenCredential implementation which chains multiple TokenCredential implementations to be tried in order until one of the getToken methods returns a non-default AccessToken.

ClientCertificateCredential

Enables authentication of a service principal in to Azure Active Directory using a X509 certificate that is assigned to it's App Registration. More information on how to configure certificate authentication can be found here: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials#register-your-certificate-with-azure-ad

ClientSecretCredential

Enables authentication to Azure Active Directory using a client secret that was generated for an App Registration. More information on how to configure a client secret can be found here: https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application

CredentialUnavailableException

An exception indicating a TokenCredential did not attempt to authenticate and retrieve AccessToken, as its prerequisite information or state was not available.

DefaultAzureCredential

Provides a default TokenCredential authentication flow for applications that will be deployed to Azure. The following credential types if enabled will be tried, in order:

Consult the documentation of these credential types for more information on how they attempt authentication.

DefaultAzureCredentialOptions

Options to configure the DefaultAzureCredential authentication flow and requests made to Azure Identity services.

DeviceCodeCredential

A TokenCredential implementation which authenticates a user using the device code flow, and provides access tokens for that user account. For more information on the device code authentication flow see https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Device-Code-Flow.

EnvironmentCredential

Enables authentication to Azure Active Directory using client secret, or username and password, details configured in the following environment variables:

VariableDescription
AZURE_TENANT_IDThe Azure Active Directory tenant(directory) ID.
AZURE_CLIENT_IDThe client(application) ID of an App Registration in the tenant.
AZURE_CLIENT_SECRETA client secret that was generated for the App Registration.
AZURE_USERNAMEThe username, also known as upn, of an Azure Active Directory user account.
AZURE_PASSWORDThe password of the Azure Active Directory user account. Note this does not support accounts with MFA enabled.
This credential ultimately uses a ClientSecretCredential or UsernamePasswordCredential to perform the authentication using these details. Please consult the documentation of that class for more details.

InteractiveBrowserCredential

A TokenCredential implementation which launches the system default browser to interactively authenticate a user, and obtain an access token. The browser will only be launched to authenticate the user once, then will silently acquire access tokens through the users refresh token as long as it's valid.

ManagedIdentityCredential

Attempts authentication using a managed identity that has been assigned to the deployment environment.This authentication type works in Azure VMs, App Service and Azure Functions applications, as well as inside of Azure Cloud Shell. More information about configuring managed identities can be found here: https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview

SharedTokenCacheCredential

Authenticates using tokens in the local cache shared between Microsoft applications.

TokenCredentialOptions

Options to configure requests made to the OAUTH identity service

UsernamePasswordCredential

Enables authentication to Azure Active Directory using a user's username and password. If the user has MFA enabled this credential will fail to get a token throwing an AuthenticationFailedException. Also, this credential requires a high degree of trust and is not recommended outside of prototyping when more secure credentials can be used.

ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnplonJ%2Bpu6bAjnqxrqqVY5alsc2toK2xX2Z7cXqPaJipoV92x7a%2BxGeAnZ2eqba1xY2hq6ak