diff --git a/sdk/e2e/src/main/java/com/azure/endtoend/identity/MultiTenantTest.java b/sdk/e2e/src/main/java/com/azure/endtoend/identity/MultiTenantTest.java index aedf2c4b6fcf..92ae60d42cc8 100644 --- a/sdk/e2e/src/main/java/com/azure/endtoend/identity/MultiTenantTest.java +++ b/sdk/e2e/src/main/java/com/azure/endtoend/identity/MultiTenantTest.java @@ -23,6 +23,7 @@ /** * Runs Identity tests across multiple tests. */ +@SuppressWarnings("deprecation") class MultiTenantTest { private static final String AZURE_MULTI_TENANT_TEST_MODE = "AZURE_MULTI_TENANT_TEST_MODE"; private static final String AZURE_USER_NAME = "AZURE_USER_NAME"; diff --git a/sdk/identity/azure-identity-extensions/src/main/java/com/azure/identity/extensions/implementation/credential/provider/DefaultTokenCredentialProvider.java b/sdk/identity/azure-identity-extensions/src/main/java/com/azure/identity/extensions/implementation/credential/provider/DefaultTokenCredentialProvider.java index 0ebfb4c525e9..e30ce7700164 100644 --- a/sdk/identity/azure-identity-extensions/src/main/java/com/azure/identity/extensions/implementation/credential/provider/DefaultTokenCredentialProvider.java +++ b/sdk/identity/azure-identity-extensions/src/main/java/com/azure/identity/extensions/implementation/credential/provider/DefaultTokenCredentialProvider.java @@ -15,6 +15,7 @@ /** * Default tokenCredentialProvider implementation that provides tokenCredential instance. */ +@SuppressWarnings("deprecation") public class DefaultTokenCredentialProvider implements TokenCredentialProvider { private final TokenCredentialProviderOptions options; diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index 42e6ec805fbf..a198d39d9bbf 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes + - Marked `UsernamePasswordCredential` and `UsernamePasswordCredentialBuilder` as deprecated. See https://aka.ms/azsdk/identity/mfa for details about MFA enforcement and migration guidance. [#44381](https://github.com/Azure/azure-sdk-for-java/pull/44381) + ## 1.15.3 (2025-02-20) ### Other Changes diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 576f836e4dbb..4807b4a1dcc6 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -301,13 +301,12 @@ Not all credentials honor this configuration. Credentials that authenticate thro ### Authenticate users -|Credential|Usage|Example|Reference| -|-|-|-|-| -|[AuthorizationCodeCredential][cred_acc]|Authenticates a user with a previously obtained authorization code as part of an OAuth 2.0 auth code flow||[OAuth 2.0 auth code][cred_acc_ref]| -|[DeviceCodeCredential][cred_dcc]|Interactively authenticates a user on devices with limited UI|[example][cred_dcc_example]|[device code authentication][cred_dcc_ref]| -|[InteractiveBrowserCredential][cred_ibc]|Interactively authenticates a user with the default system browser|[example][cred_ibc_example]|[OAuth 2.0 auth code][cred_acc_ref]| -|[OnBehalfOfCredential][cred_obo]|Propagates the delegated user identity and permissions through the request chain||[On-behalf-of authentication][cred_obo_ref]| -|[UsernamePasswordCredential][cred_upc]|Authenticates a user with a username and password without multi-factor auth|[example][cred_upc_example]|[Username + password authentication][cred_upc_ref]| +|Credential| Usage |Example|Reference| +|-|-----------------------------------------------------------------------------------------------------------|-|-| +|[AuthorizationCodeCredential][cred_acc]| Authenticates a user with a previously obtained authorization code as part of an OAuth 2.0 auth code flow ||[OAuth 2.0 auth code][cred_acc_ref]| +|[DeviceCodeCredential][cred_dcc]| Interactively authenticates a user on devices with limited UI |[example][cred_dcc_example]|[device code authentication][cred_dcc_ref]| +|[InteractiveBrowserCredential][cred_ibc]| Interactively authenticates a user with the default system browser |[example][cred_ibc_example]|[OAuth 2.0 auth code][cred_acc_ref]| +|[OnBehalfOfCredential][cred_obo]| Propagates the delegated user identity and permissions through the request chain ||[On-behalf-of authentication][cred_obo_ref]| ### Authenticate via development tools @@ -344,15 +343,6 @@ Credentials can be chained together to be tried in turn until one succeeds using |`AZURE_CLIENT_CERTIFICATE_PATH`|path to a PFX or PEM-encoded certificate file including private key| |`AZURE_CLIENT_CERTIFICATE_PASSWORD`|(optional) password for certificate. The certificate can't be password-protected unless this value is specified.| -### Username and password - -|Variable name|Value| -|-|-| -|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application| -|`AZURE_TENANT_ID`|(optional) ID of the application's Microsoft Entra tenant| -|`AZURE_USERNAME`|a username (usually an email address)| -|`AZURE_PASSWORD`|that user's password| - ### Managed identity (`DefaultAzureCredential`) |Variable name|Value| @@ -441,9 +431,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [cred_mic_example]: https://github.com/Azure/azure-sdk-for-java/wiki/Azure-Identity-Examples#authenticating-in-azure-with-managed-identity [cred_obo]: https://learn.microsoft.com/java/api/com.azure.identity.onbehalfofcredential?view=azure-java-stable [cred_obo_ref]: https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow -[cred_upc]: https://learn.microsoft.com/java/api/com.azure.identity.usernamepasswordcredential?view=azure-java-stable -[cred_upc_example]: https://github.com/Azure/azure-sdk-for-java/wiki/Azure-Identity-Examples#authenticating-a-user-account-with-username-and-password -[cred_upc_ref]: https://learn.microsoft.com/entra/identity-platform/v2-oauth-ropc [cred_vsc]: https://learn.microsoft.com/java/api/com.azure.identity.visualstudiocodecredential?view=azure-java-stable [cred_vsc_example]: https://github.com/Azure/azure-sdk-for-java/wiki/Azure-Identity-Examples#authenticating-a-user-account-with-visual-studio-code [cred_vsc_ref]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/EnvironmentCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/EnvironmentCredential.java index 710fa17053b4..f212e31204c8 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/EnvironmentCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/EnvironmentCredential.java @@ -38,6 +38,8 @@ * * *

The required environment variables for username password authentication are as follows:

+ *

Deprecated: Username and password authentication doesn't support multifactor authentication (MFA). + * For more details on Microsoft Entra MFA enforcement, see here.

*