keyvault-agent-azure-auth 0.1.0-alpha

unofficial library for Azure authentication in Rust (experimental)
Documentation

azure-auth

A library for Azure authentication in Rust.

  • Obtain tokens from a logged-in Azure CLI
  • Obtain tokens for a managed identity - either from an Azure VM or Cloud Shell
  • Obtain tokens directly using username/password or application ID and secret

Example

let authentication_uri = "https://login.windows.net/{tenant}";
let resource_uri = "https://vault.azure.net";

let auth_response = AzureCliAuthenticator::new()
    .authenticate(TokenRequestOptions::from_resource_uri(
        resource_uri,
        authentication_uri,
    ))
    .await;

println!("Auth response: {:?}\n", auth_response);