#azure #applications #managed #identity #obtain #tokens

keyvault-agent-azure-auth

unofficial library for Azure authentication in Rust (experimental)

1 unstable release

0.1.0-alpha Jun 16, 2020

#908 in Authentication


Used in 2 crates

MIT/Apache

31KB
760 lines

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);

lib.rs:

A library for Azure authentication

Currently supported authentication mechanisms are

  • AzureCLI - obtain tokens from a logged-in Azure CLI
  • ManagedIdentity - obtain tokens from an Azure VM's managed identity or from Cloud Shell
  • UserPassword - authenticate using a username and password
  • Application - authenticate using an application ID and secret

Dependencies

~7–11MB
~229K SLoC