CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-com-azure--azure-identity

The Azure Identity library provides Microsoft Entra ID token authentication support across the Azure SDK with a comprehensive set of TokenCredential implementations.

Pending
Overview
Eval results
Files

username-password-authentication.mddocs/

Username Password Authentication

DEPRECATED: Authenticates using username and password credentials. This credential type is deprecated due to lack of multifactor authentication support.

Capabilities

Username Password Credential

Provides username and password authentication for legacy scenarios.

/**
 * Username password authentication credential
 * @deprecated Does not support multifactor authentication (MFA)
 */
@Deprecated
class UsernamePasswordCredential implements TokenCredential {
    Mono<AccessToken> getToken(TokenRequestContext request);
    AccessToken getTokenSync(TokenRequestContext request);
    Mono<AuthenticationRecord> authenticate(TokenRequestContext request);
    Mono<AuthenticationRecord> authenticate();
}

@Deprecated
class UsernamePasswordCredentialBuilder extends AadCredentialBuilderBase<UsernamePasswordCredentialBuilder> {
    UsernamePasswordCredentialBuilder username(String username);
    UsernamePasswordCredentialBuilder password(String password);
    UsernamePasswordCredentialBuilder tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions);
    UsernamePasswordCredentialBuilder additionallyAllowedTenants(String... additionallyAllowedTenants);
    UsernamePasswordCredentialBuilder additionallyAllowedTenants(List<String> additionallyAllowedTenants);
    UsernamePasswordCredential build();
}

Usage Examples:

import com.azure.identity.UsernamePasswordCredential;
import com.azure.identity.UsernamePasswordCredentialBuilder;

// DEPRECATED - Not recommended for production use
TokenCredential credential = new UsernamePasswordCredentialBuilder()
    .clientId("your-client-id")
    .tenantId("your-tenant-id")
    .username("user@example.com")
    .password("password")
    .build();

// Interactive authentication to get AuthenticationRecord
AuthenticationRecord record = credential.authenticate().block();

Deprecation Notice

This credential is deprecated because it does not support:

  • Multifactor authentication (MFA)
  • Conditional access policies
  • Modern security requirements

Recommended Alternatives:

  • InteractiveBrowserCredential for user authentication
  • DeviceCodeCredential for device-based authentication
  • ClientSecretCredential for service principal authentication

Exception Handling

May throw AuthenticationRequiredException when interactive authentication is required due to security policies.

Install with Tessl CLI

npx tessl i tessl/maven-com-azure--azure-identity

docs

advanced-authentication-flows.md

authorization-code-authentication.md

azure-developer-cli-authentication.md

azure-pipelines-authentication.md

client-assertion-authentication.md

configuration-and-utilities.md

credential-chaining.md

default-azure-credential.md

developer-tool-credentials.md

environment-credential.md

index.md

interactive-user-authentication.md

managed-identity-credential.md

service-principal-authentication.md

shared-token-cache-authentication.md

username-password-authentication.md

visual-studio-code-authentication.md

tile.json